I'm sorry if this seems trite, but I suspect the error message means that the system is trying to generate an rndc key in /etc/rndc.key
. Such a key is needed for correct operation of BIND as it's configured out-the-box in CentOS, though it would only need to be created that first time.
I suspect it's hanging on the creation because you're ssh'ed onto a remote server, one without a handy human being attached via keyboard and mouse, who can provide the entropy that such a key generation requires.
You can test the first part of this hypothesis by doing
ls -al /etc/rndc.key
If it's not there, that's the problem.
You can test the second part by doing
sudo rndc-confgen -a -c /etc/rndc.key
on your remote server. If it hangs, try doing
rndc-confgen -a -c /tmp/disposable.key
on your remote server. If it, too, hangs, the problem is not with the file /etc/rndc.key
, but with the act of key generation, as I suspect. Try
rndc-confgen -a -c /tmp/disposable.key
on your local desktop (assuming that you have the bind
package installed, or whatever is suitable for your local distro). If that completes, the problem is very likely the availability of entropy (desktops have a lot of it, colocated servers less so; as I said, having a human being on the end of a HID cable makes lots of useful randomness available to the system).
You can either arrange for the remote system to have some entropy (which is somewhat beyond the scope of this answer), or generate the keyfile locally and copy it up to the server (it's only a correctly-formatted, pre-shared nonce secret).
If you do the latter, make sure the file is owned by root:named
and mode 440
on the remote system.