When ndc and bind reload won't work (ndc: error: ctl_client)

Written by - 0 comments

Published on - Listed in Linux

DNS server problems are usually (and thank god!) rare. But when they happen, a fast resolution is of course necessary - or the impact can be catastrophic. Unless it's on a slave server, like in my case; this gives a bit more time to troubleshoot.

It all started with a domain which was stated as 'failed' by checking it on a whois server. I thought that the domain was probably not synchronized between master and slave and did the synchronization manually. At the point of reload, the following error appeared:

# ndc reload
ndc: error: ctl_client: evConnect(fd 3): No such file or directory
ndc: error: cannot connect to command channel (/var/run/ndc)

The same also happened, when I launched /etc/init.d/bind reload - not good! Something's pretty wrong here.

I quickly checked the socket file, which indeed didn't exist anymore:

# ll /var/run | grep ndc

The socket file disappeared?? When did that happen? How can it happen?
Even a bind restart didn't work so I forced a stop and start of bind and the socket file was there again:

# /etc/init.d/bind stop
# /etc/init.d/bind start
# ll /var/run | grep ndc
srw-rw-rw-  1 root  root    0 2011-10-27 15:30 ndc

But as soon as I launched ndc reload or bind reload, the same error showed up again! Even though the socket file was now there.

I then took a closer look at /etc/bind/named.conf. It contained several includes:

// add local zone definitions here
include "/etc/bind/named.conf.local";
include "/etc/bind/named.additional.conf";
include "/etc/bind/named.additional2.conf";

The bad thing is that the two additional config files didn't exist anymore so bind was trying to load config files which weren't there.
After I removed the lines with the non-existant files and restarted bind, a new socket file with different permissions was created:

# ll /var/run | grep ndc
srw-------  1 root  root    0 2011-10-27 15:47 ndc

That seems to be a good change, so let's check the reload:

# ndc reload
Reload initiated.
# /etc/init.d/bind reload
Reload initiated.

So watch out if you ever use non-existant files in a bind configuration, it doesnt like it at all!

Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.