Recently we performed the following on our DNS server running FreeBSD 9.1:
freebsd update fetch && freebsd update install
Always smooth sailing. 🙂
So, today we got a new laptop which meant setting up the DNS records for it to run on our network. We added the necessary forward and reverse DNS records in named. After doing so, the normal practice is to run
rndc reload so the system will reload and recognize the new DNS records. A very simple process. But today was a very different story. Today, running
rndc reload produced this error message:
rndc: neither /usr/local/etc/rndc.conf nor /usr/local/etc/rndc.key was found
Huh? Out of the blue rndc does this? Well guess what, the named port got upgraded, so go figure.
Now we noticed the symbolic link
/usr/local/etc/rndc.key was missing, so let’s create it:
ln -s /etc/named.rndc.key /usr/local/etc/rndc.key
rndc reload produced this error:
rndc: 'reload' failed: not found
It would have been nice if the message had told me exactly what file was not found. But looking in the /var/log/daemon.log file pointed me in the right direction as to what was going wrong:
May 19 15:11:19 ns named: received control channel command 'reload'
May 19 15:11:19 ns named: loading configuration from '/usr/local/etc/named.conf'
May 19 15:11:19 ns named: open: /usr/local/etc/named.conf: file not found
May 19 15:11:19 ns named: reloading configuration failed: file not found
Normally it should look in /etc/named/named.conf for the configuration file but our new version now has a new path it is looking in.
So we then added the following to the /etc/rc.conf file:
service named restart
/etc/rc.d/named: WARNING: failed to start named
Blamo! Named stopped and could not start back up, no thanks to our new config line. It again produced the same error in the log file. And now, there was no named service running. Double ugh.
This command fixed that and pointed it to the correct config file:
/usr/local/sbin/named -t /var/named -u bind -c /etc/namedb/named.conf
Now the named service is up and running and
rndc reload runs as normal. Great!
Now we just need to do a reboot of the system (when there is little traffic) to see if named starts up normally after adding that line to