Setting up Private Nameservers in Cpanel Published: Oct 28, 2003
  • Rating


We'll show you the ropes in how to setup cpanel nameservers and configure them properly so you can run ns1 and

This guide will show you the ropes in how to setup cpanel nameservers and configure them properly so you can run ns1 and Once your nameservers are setup clients can then use your own private nameservers for their domains.

1. Regiser your domain
Register the domain name you would like to use, you can register a domain here if you need one.This domain will be used as your nameservers - eg and

2. Additional IPs
Have 2 available IP addresses for your server that aren't in use.You will need to contact you provider to obtain these IP addreses.

3. Registering the Nameservers  
Now login to your domain management page for the domain you registered and  register and as nameservers (registries normally have a special facility for doing that). The registry may also have a facility to propogate these nameservers around the foreign registries - if so, you should use this facility.

These registrations may take a few days to propagate (often as many as 3 days).

4. Reverse DNS
You may also need to get your data centre to enter a reverse DNS pointer for your nameservers. You'll need to let them know each nameserver and its IP address. Sometimes you can suffer non-delivery of mail if you don't so this. Reverse DNS pointers can take a while to propagate.
Setup a reverse on the IP address for your domain

5. Broken NDC/BIND
My version of WHM/CPanel came with a broken NDC. To fix this:

SSH into your box as root.

(a) Type: cd /scripts
(b) Type: ./updatenow
(c) Type: ./fixndc

Go back into WHM, go to the Restart Services section in the left menu and click DNS/Nameserver (BIND).

You will need to do this if you start getting 'ndc' errors when you are doing anything DNS related in WHM.

6. Setup Nameservers In WHM
Go into WHM (Web Host Manager) and select Edit Setup from the Server Setup menu on the left. Enter in the Primary Nameserver field. Hit 'Assign IP Address', then hit 'Add an A Entry for this nameserver'.
Repeat this process for the Secondary Nameserver field.

7. Tidy Up Junk Nameservers
Go into WHM (Web Host Manager) and select Manage Nameserver IPs from the Server Setup menu on the left. Remove any nameservers you don't recognise. This is just a tidy up exercise in case anyone's set anything up on the box before you.

8. Initial Nameserver Setup
Go into WHM (Web Host Manager) and select Initial NameServer Setup from the Server Setup menu on the left. Run this.

9. Restart BIND
Restart BIND (step 7 restarts BIND, but we've known it to need a proper stop and start for it to work) from SSH with:

service named stop
service named start

10. Manual Checks
I don't know what it is about this process, but it doesn't always work, so there are some things you can check manually via SSH.

Check that the nameservers are correctly specified on NS, NS2 etc.
EG: scroll to the name servers section.....

Check that there are nameserver entries for each IP. There may also be one for - this is okay. I'm led to believe (by the 'man' entry for resolv.conf) that this isn't a particularly important file, but I changed mine to read:


Where '' is the main domain of my server, and '' and '' are the IP addresses of my primary and secondary nameservers.

resolv.conf is used to lookup names that are not in FQDN format.

Check that there are entries for each IP acting as a nameserver.

  • Rating


Related Articles

Comments (25)

  • Gravatar - Jason Ruyle
    Jason Ruyle 00:22, December 7, 2003
    I'm trying to manually setup my name servers. But I dont know how they should look in:




    Could you make a general format? Thanks.
  • Gravatar - Ramprage
    Ramprage 00:36, December 8, 2003
    Article updated
  • Gravatar - Curtis
    Curtis 18:13, April 10, 2004
    Awesome! Walked me thru it step by step. Thanks!
  • Gravatar - tony
    tony 20:20, May 19, 2004
  • Gravatar - roy
    roy 07:37, May 23, 2004
    I can't seem to find Initial NameServer Setup from the Server Setup menu on the left of WHM.
  • Gravatar - janitor
    janitor 15:06, June 12, 2004
  • Gravatar - monkeygirl
    monkeygirl 16:45, September 8, 2004
    thanks for the info!
  • Gravatar - Charlie
    Charlie 06:39, November 26, 2004
    On my server WHM 9.9.8 cPanel 9.9.8-R119 there was no Initial Nameserver Setup but I did find Nameserver Setup under Service Configuration and this seemed to work just fine.<br />
    <br />
    When I typed /etc/resolv.conf I would get a message 'Permission Denied'. Seemed that typing 'cat /etc/resolv.conf' solved this problem.<br />
  • Gravatar - Charlie
    Charlie 13:57, November 26, 2004
    To output the resolv.conf you must type<br />
    <br />
    'cat /etc/resolv.conf'<br />
    <br />
    To edit resolv.conf use pico / type:<br />
    <br />
    'pico /etc/resolv.conf'<br />
    <br />
    In my Web Host Manager there was no 'Initial NameServer Setup' under the Server Setup menu but there was a 'NameServer Setup' under 'Service Configuration'. Used this instead and it seemed to work.
  • Gravatar - Charlie
    Charlie 14:37, November 26, 2004
    I had a huge problem with the /scripts/named.conf not working and getting errors when I tried to Bind. This forum solved those problems:<br />
    <br /><br />
  • Gravatar - Gabidi
    Gabidi 20:53, December 24, 2004
    When i ever i try to setup i get the following error after entering a Name server assigning it an IP and then attempting to add an entry for it:<br />
    <br />
    "IP= Bind reloading on orion using rndc zone: [] Error reloading bind on orion: rndc: connection to remote host closed This may indicate that the remote server is using an older version of the command protocol, this host is not authorized to connect, or the key is invalid. Add Complete" <br />
    <br />
    Any ideas ?
  • Gravatar - Tong Narak
    Tong Narak 12:07, June 28, 2005
    /etc/resolv.conf<br />
    <br />
    I think these should be<br />
    Datacenter DNS.<br />
    <br />
    <br />
    ------------------------------------<br />
    <br />
    Resolver Setup <br />
    Enter the ip address of at least two nameservers that you will use for dns resolution. Your datacenter should be able to provide you with at least one ip of a dns server you can access. If you do not know the ip address of your provider's local resolvers you should contact them. It is very important that these nameservers are correct, or you server will not function properly. If you do not know what to put in the boxes below and cannot contact your provider, please close this window and go though this setup at a later time; Your server should still function normally, however connections made to the server may be slower then normal.
  • Gravatar - Martyn
    Martyn 10:11, August 1, 2005
    Re: Tong Narak<br />
    <br />
    You are correct, these IP addresses should be the ones provided by your host, they are internal and point to your internal DNS resolvers.
  • Gravatar - Joe A
    Joe A 12:28, November 19, 2005
    This is the first time I've ever seen a comprehensive explanation of how to do this. Thank you.
  • Gravatar - josh
    josh 06:16, February 13, 2006
    Yeah, well i have added the nameserver/ip/info and followed what was said, but i can only resolve hosts via nslookup on that LOCAL machine, the outside world never resolves correctly, any clues?
  • Gravatar - Aziz
    Aziz 05:25, March 10, 2006
    You can actually put any name servers any /etc/resolve.conf, it is just a resolver and has nothing to do with running a DNS server.
  • Gravatar - alberto
    alberto 02:58, April 29, 2006
    4. Reverse DNS<br />
    You may also need to get your data centre to enter a reverse DNS pointer for your nameserv.....<br />
    <br />
    ALLL OK BUT STEP 4.. what i have to do here? contact with my ISP?<br />
    <br />
    thank you!
  • Gravatar - David K. Tucker
    David K. Tucker 09:13, May 6, 2006
    Truly appreciate the help. Set my ATJEU.COM dedicated nameservers up in no time :-) Really appreciate it.<br />
    <br />
  • Gravatar - Sparky
    Sparky 05:11, July 21, 2006
    Great tutorial - one problem though - dns server appears to work, but now doing a hostname lookup to hosts outside of the server (to, for example) fails.<br />
    <br />
    Hostname lookups to hosts on the dns server work fine, just cannot see any hosts outside of the server.<br />
    <br />
    /etc/resolv.conf looks like:<br />
    <br />
    domain<br />
    search<br />
    nameserver x.x.x.x<br />
    nameserver x.x.x.x<br />
    <br />
    Any thoughts?
  • Gravatar - Koh Kok Yew
    Koh Kok Yew 20:52, August 31, 2006
    To Gabidi:<br />
    <br />
    To fix this issue you may try running `/scripts/fixndc`
  • Gravatar - ZeRoo!
    ZeRoo! 02:06, January 22, 2007
    thank you!
  • Gravatar - Deni Wibowo
    Deni Wibowo 11:15, July 5, 2007
    I have same problem on named failure.<br />
    I just removing them an then reinstall using yum.<br />
    <br />
    #yum remove bind<br />
    #yum install bind bind-chroot bind-devel caching-nameserver<br />
    <br />
    and then restarting bind<br />
    <br />
    #service named start<br />
    <br />
    and done.
  • Gravatar - Dr Tokunboh
    Dr Tokunboh 10:02, October 19, 2007
    this is kind of difficult. i dont think i can handle ssh - what can i do?
  • Gravatar - dvijai
    dvijai 11:29, August 1, 2010
    I afraid to understand theat in domain control penal, wher to register, i maen, under which tab we need to register the ns1 and ns2, while there are many tabs like overview, name server, child name server, and many more.

    i am talking about pont no. 3. Registering the Nameservers
  • Gravatar - Myth
    Myth 08:40, August 2, 2010

Add Your Thoughts is a hosting directory, not a web host.

Copyright © 1998-2016