Configuring A DNS Server In Cpanel

The procedure

(domain.com is used in the procedure as an example, use your domain name instead)

  1. Register the nameservers ns1.domain.com and ns2.domain.com with your domain name registrar using two different IP addresses on your server. (You may contact your registrar for the procedure to complete that step).
  2. Once your nameservers are registered, log on to your WHM control panel as root.
  3. Click on "Server Configuration".
  4. Click on "Basic cPanel & WHM Setup".
  5. Scroll down to the bottom, into the "Nameserver 1" field, enter the primary NS that you have registered (ns1.domain.com).
  6. Click on Assign IP Address
  7. Click on "Add an A entry for this nameserver" and confirm by clicking on "Add Entry".
  8. Into the "Nameserver 2" field, enter the name of the secondary NS that you have registered (ns2.domain.com).
  9. Click on Assign IP address.
  10. Click on "Add an A entry for this nameserver" and confirm by clicking on "Add Entry". 

Note:

If the IP addresses to your nameservers are not assigning correctly, you can then edit the file manually:

  • Connect to your server as root in a SSH session.
  • Edit the file /etc/nameserverips
  • Type in the correct IP addresses in a manner similar to this:

             xx.xx.xx.xx=ns1.domain.com
             xx.xx.xx.xy=ns2.domain.com

  • Restart named service: /etc/init.d/named restart
  • Make sure to add the A entries corresponding to ns1 and ns2 with the correct IP on your domain's DNS zone.

Script Ad