Edit cPanel nameserver IP’s

  • Post author:
  • Post category: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:
123.456.789.012 ns1.domain.com
123.456.789.012 ns1.domain.com ns2.domain.com
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


I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....