cPanel Name Server Setup

It seems no matter which flavor of linux / unix you are running and which control panel software that setting up custom name servers is always a problem. This How-To will be for installing name servers on a Linux CPanel server. Custom Name Servers are great because you can provide your webhosting customers with ns1.yourcompany.com instead of your server / upllink providers name servers. You will also know how to install Custom name servers for your reseller accounts.

1. Register Name Servers where you registered your domain at.
I suggest using 1 IP per name server.
NS1.yourdomain.com = IP#1
NS2.yourdomain.com = IP#2

2. Notify your DataCenter to setup Reverse DNS for the IP addresses used above
and for your name servers. (Normally you put in a ticket to request RDNS for “NS1.yourdomain.com = IP#1 NS2.yourdomain.com = IP#2” and they will complete this within a day)

Please note it can take up to 36 hours for your name servers to propogate through the web. Once they have propogated procede to step #3.

1. Login to WHM as root

2. Click “Edit Setup” from the left hand menu. (x2 theme)

3. Type: ns1.yourdomain.com in the Primary Nameserver field.

4. Press Assign IP Address

5. Then Press Add an A Entry for this nameserver

6. Type ns2.yourdomain.com in the Secondary Nameserver field.

7. Click Assign IP Address

8. Then Click Add an A Entry for this nameserver

9. Click Manage Nameserver IPs from the left menu in WHM.

10. If you see any nameservers that do not belong to you, remove them now.

11. Click Initial NameServer Setup from the left menu in WHM
Run this for the “initial name server setup”

12. Login to SSH to restart bind. (Be sure it restarts, so don’t do this in WHM)

13. Type: service named stop

14. Type: service named start

15. While in SSH do the following to verify installation has gone well.

16. Type: pico /etc/wwwacct.conf
Scroll to the bottom and insure that your name servers are listed like this:
NS ns1.yourdomain.com
NS2 ns2.yourdomain.com

17. While still in SSH do the following to verify installation has gone correctly.
Type: pico /etc/resolv.conf
It should look like this:

domain yourdomain.com
search yourdomain.com
#nameserver 127.0.0.1
nameserver ip address #1 here
nameserver ip address #2 here

18. Check one more thing in SSH to make sure Name Server Configuration went GOOD.
Type: pico /etc/nameserverips
It should look like this:
ip address 1=ns1.yourdomain.com
ip address 2=ns2.yourdomain.com

There may be more IP Addresses that are equal to 0 this is ok.

Posted by wiredgorilla