Unable to restart named

Getting the following errors while trying to restart named in a cPanel server.

root@host [~]# service named restart
Stopping named: [FAILED]
Starting named: [FAILED]

root@host [~]# service named status
rndc: connection to remote host closed
This may indicate that the remote server is using an older version of
the command protocol, this host is not authorized to connect,
or the key is invalid.

So named restart failed. Next step is to find the exact reason and this can be find out in /var/log/messages. In my case I got the following error in /var/log/messages while restarting named.

May 5 01:44:51 host named[7460]: starting BIND 9.3.3rc2 -u named
May 5 01:44:51 host named[7460]: found 4 CPUs, using 4 worker threads
May 5 01:44:51 host named[7460]: loading configuration from '/etc/named.conf'
May 5 01:44:51 host named[7460]: no IPv6 interfaces found
May 5 01:44:51 host named[7460]: listening on IPv4 interface lo, 127.0.0.1#53
May 5 01:44:51 host named[7460]: listening on IPv4 interface venet0:0, 67.222.12.150#53
May 5 01:44:51 host named[7460]: listening on IPv4 interface venet0:1, 67.222.13.150#53
May 5 01:44:51 host named[7460]: /etc/rndc.key:1: configuring key 'rndc-key': bad base64 encoding
May 5 01:44:51 host named[7460]: loading configuration: bad base64 encoding
May 5 01:44:51 host named[7460]: exiting (due to fatal error)

 

This error is due to the mismatch of the secret key in /etc/rndc.conf and the include file /etc/rndc.key. Both the keys should be the same.

After copying the secret key from the file /etc/rndc.conf to /etc/rndc.key, named was restarted successfully.

root@host [~]# service named status
number of zones: 19
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/1000
tcp clients: 0/100
server is up and running

Both comments and pings are currently closed.

Comments are closed.