Home / cPanel / Setting Private name servers in Cpanel / WHM

Setting Private name servers in Cpanel / WHM

cPanel 0

If you want your own name server such as ns1.linuxbabu.net, ns2.linuxbabu.net

Please follow the below steps to setup your own nameservers.

Step 1. Log into your domain manager account, via your domain registrar’s web site
(i.e. www.godaddy.com , www.enom.com , …)

Step 2: You will need to name your DNS server and insert a valid ip that is bound to your server. This will cause your server to get “mapped” on the Internet as being an operational DNS server.

For this example, my domain name is ‘linuxbabu.net’ and the IP’s bound to my server are “” (Primary IP) and “” (Secondary IP). I will be using the hostname ‘ns1.linuxbabu.net’ bound to the “” IP, and ‘ns2.linuxbabu.net’ bound to the “” IP.

Note : The hostname ‘ns1.linuxbabu.net’ and ‘ns2.linuxbabu.net’ are not mandatory. You can use any name along with your domain name. The name ‘ns1’ is simply easy to remember for both the sys admin, and the customer.

Step 3: The last step is to basically say which DNS server is authorized to resolve the domain ‘linuxbabu.net’ to an IP. We will have to input the hostnames that we specified in step 2, which are: ‘ns1.linuxbabu.net’ and ‘ns2.linuxbabu.net’.

Note: If you wish to use your DNS server to resolve other domains besides ‘linuxbabu.net’ you should repeat only step 3, which is basically telling your domain registrar who is the authoritative DNS server for the domain.

Part 2: cPanel DNS Configuration

Now that we’ve established our DNS Internet Awareness through our domain registrar, we will have to configure cPanel to finalize our settings

Step 1. Login to your whm and then Main >> DNS Functions >> Add a DNS Zone



Main >> Server Configuration >> Basic cPanel/WHM Setup

Primary Nameserver & Secondary Nameserver

Click on “Assign Ip Address”

If it does not assign the right ip address then login to the server through ssh



nano /etc/nameserverips

Change to


once the correct Ip are assigned to name servers

Click on “add A entery for this name server”

This will the A entry for nameservers.


Check the nameservers IP

Main >> Networking Setup >> Nameserver IPs

It should showup the correct nameservers and their IPs

Ip Nameserver ns1.linuxbabu.net ns2.linuxbabu.net

Known Issue : When I try to edit my nameserver IPs, two nameservers keep showing up even though I keep manually deleting them from /etc/nameserverips and restarting named. ns1.linuxbabu.net and ns2.linuxbabu.net always keep taking up my first two IP addresses, and I have never added these domains.

Fix :
From WHM Main >> Server Configuration >> Tweak Settings select the option “Disable whois lookups for the nameserver IP manager.” and reconfigure the NS and you are done.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Previous Post

    How do I view what exim is doing?

    Next Post

    semget: No space left on device