Symptoms

  1. DNS does not work, bind service failed to start:

    # /etc/init.d/named start
    Error in named configuration:
    /etc/named.conf:10: open: /etc/rndc.key: file not found
    
  2. rndc.key file is missing:

    # ll /var/named/run-root/etc/rndc.key
    ls: cannot access /var/named/run-root/etc/rndc.key: No such file or directory
    
  3. Task Update named pa115dns1.domain.tld fails with error like:

    Multiple errors during NS update: Destination host 'pa115dns1.domain.tld' (#4), IP '192.168.2.43' : Internal error: /usr/sbin/rndc /usr/sbin/rndc reconfig failed with code 1 saying: STDOUT: '' STDERR 'rndc: error: /etc/rndc.conf:1: open: /etc/rndc.key: file not found
    rndc: could not load rndc configuration
    

Cause

Re-attaching DNS node corrupted the DNS configuration.

Resolution

  1. Generate a new key with the following command:

    # rndc-confgen -a -c /var/named/run-root/etc/rndc.key
    
  2. Set correct permissions:

    # chgrp named /var/named/run-root/etc/rndc.key
    # chmod 640 /var/named/run-root/etc/rndc.key
    # ls -la  /var/named/run-root/etc/rndc.key
    -rw-r----- 1 root named 77 Mar 21 15:27 /var/named/run-root/etc/rndc.key
    

Note: /var/named/run-root/var/pem_zones file can be corrupted too, please check this article if fix is needed.

Internal content