Last Updated:

Edit cPanel nameserver IP’s

Categories cPanel

As of WHM 11.30, the nameservers’ IP assignments are now read from the Zonefiles and actual DNS queries after recent updates. If you are not seeing the needed IPs in /etc/nameserverips please do not attempt to edit that file, as it is now overwritten by cPanel.

Check under WHM: Main >> DNS Functions >> Nameserver IPs for current nameserverips

(Solutions may depend on the cPanel version)

The updated A entries and/or NS entries are not retained:
Add the needed nameservers to the /etc/hosts file
vim /etc/hosts
Add (append) a new line, one per IP, onto the existing hosts file such as:
Then run the updatenameserverips script:
Check under WHM: Main >> DNS Functions >> Nameserver IPs again to see if it worked, if not continue

Delete the nameserverips.cache file
rm /var/cpanel/nameserverips.cache

Then modify /var/cpanel/nameserverips.yaml to suite
vim /var/cpanel/nameserverips.yaml

Then run the updatenameserverips script again