This article provides a resolution in case you experience a corrupted named.conf file on a cPanel VPS or cPanel dedicated server.
The named.conf file is the configuration file for BIND nameserver. In certain circumstances, this file may become corrupted and the following steps can be taken to restore it to a functional state.
Move Existing named.conf
As the root user, run the following command to move your existing named.conf file:
$ mv /etc/named.conf /etc/named.conf.bak
Run cPanel-Provided Script
Run the following cPanel script on your server to rebuild named.conf:
$ /usr/local/cpanel/scripts/rebuilddnsconfig
Restart the named service
Execute the following command as root user:
$ /etc/init.d/named restart
Following the restart, your server will have proper named.conf file.