This article provides a guide to fix corrupted named.conf file on cPanel/WHM servers. This guide requires root-level access and is intended for administration of cPanel VPS or cPanel dedicated servers.
Issues with named.conf File
Sometimes named.conf becomes corrupted on cPanel server.
How to Fix Corrupted named.conf Files
Here is the way to fix that in cPanel servers:
- First, login to the server as root user and move the corrupted named.conf using the following command:
root@cpanelserver[~]# mv /etc/named.conf /etc/named.conf.bak
- Now, execute the following cPanel script to rebuild the named.conf:
root@cpanelserver[~]# /usr/local/cpanel/scripts/rebuilddnsconfig
- And restart the named service:
root@cpanelserver[~]#/etc/init.d/named restart
The WHM/cPanel server's named.conf is now rebuilt and operating as normal. Feel free to remove /etc/named.conf.bak
once you have verified your DNS rebuild was successful.