rndc: connection to remote host closed

“rndc: connection to remote host closed” error often happen while starting named — usually because of missing rndc.key, corrupt rndc.key or misconfigure in named configuration file or permission and ownership issue.

How to fix this problem?

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.

There are a few way to get around this:
[*] Sometime you just need to replace the key value at /etc/rndc.conf based on /etc/rndc.key. Make sure its the same.
[*] Delete the following from your named.conf
key rndc-key {
algorithm hmac-md5;
secret "xxxxxxxxxxxxxxxxxxxxxxx==";
};
controls {
inet * port 953 allow { any; } keys { rndc-key; };
};

[*] Generate a new key (will write it later).
[*] If you are on CPanel server, the following should do the trick:
Type: cd /scripts
Type: ./updatenow
Type: ./fixndc
Type: ./fixndc

Yes, twice.
[*] Ensure the rndc.key file permission is 640
[*] Ensure the rndc.key file owner is root:named
[*] Restart named
service named restart

Good luck!

No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: