Monday, January 24, 2011

a bind slave configuration on ubuntu is sometimes vexing

while installing a slave dns server with bind on an ubuntu box, i found that the slave zone would not synchronize. logs are your friends. in /var/log/daemon.log , I saw the following:
named[4402]: dumping master file: /etc/bind/tmp-xxxxxxx: open: permission denied
named[4402]: transfer of '' from master#53: failed while receiving responses: permission denied
it appears that named was unable to write to /etc/bind/ .
after some digging and using strace, i discovered that ubuntu is shipped with slave zone files residing here:
in /etc/bind/named.conf the zone definition ought to have the following format:
zone "" IN {
        type slave;
        file "/var/cache/bind/";
        masters {; };
(or no path to the file)

and have the correct permissions:
# chown -R bind:bind /var/cache/bind/
# chmod -R g+w /var/cache/bind/
bind also needs permissions to write to various zone files, in:
however, my slave zone would still not synchronize. this was due to apparmor (sure, i knew that); edit:

change: /etc/bind/** r,
to: /etc/bind/** rw,
some other excitement is to actually resolve things on the localhost.


and in /etc/bind/named.conf.options include the following stanza:
        forwarders {
      ; <- our friend google for ext lookups
      ; <- our friend google for ext lookups
      ; <- an internal server for internal lookups

Monday, January 17, 2011

ubuntu host, let's rename you, shall we?

easy peasy.

to change an ubuntu system's hostname, do the following:
# /bin/hostname
# vi /etc/hosts
# grep -r /etc
# /etc/init.d/cron restart
on a debian system, do the following:
# /bin/hostname
# vi /etc/hostname
# vi /etc/hosts
# grep -r /etc
# sysctl
# /etc/init.d/cron restart