WebHostGear.com - the hosting resource for professionalshosting tutorials 
hosting howto webhost guide server managementSeptember 05, 2008
server management, apache tutorials, hosting tutorials, cpanel, server security
Home / Hosting Tutorials / cPanel Tutorials / Setting up Private Nameservers in Cpanel

Setting up Private Nameservers in Cpanel



Printer Friendly Printer Friendly Send to a friend Send to a friend
By : ramprage Rating : Average Rating : 7.64 From 107 Voter(s)

This guide will show you the ropes in how to setup cpanel nameservers and configure them properly so you can run ns1 and ns2.yoursite.com. 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 ns1.yourdomain.com and ns2.yourdomain.com

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 ns1.newdomain.com and ns2.newdomain.com 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).

Article provided by WebHostGear.com
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



Article provided by WebHostGear.com

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 ns1.newdomain.com 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.

/etc/wwwacct.conf
Check that the nameservers are correctly specified on NS, NS2 etc.
EG: scroll to the name servers section.....
NS ns1.yournameserver.com
NS2 ns2.yournameserver.com

/etc/resolv.conf
Check that there are nameserver entries for each IP. There may also be one for 127.0.0.1 - 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:

domain mybox.com
search mybox.com
nameserver 127.0.0.1
nameserver 111.111.111.111
nameserver 222.222.222.222

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

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

/etc/nameserverips
Check that there are entries for each IP acting as a nameserver.
EG:
IPHERE=ns1.yournameserver.com
IPHERE=ns2.yournameserver.com

New! - Need server help? Hire an Expert

Get professional help with your configuration, script installation or server issue.
Learn how we can help you with any server problem and make your server run like new. Professional staff will contact you, after submitting a quote request, by phone or email.

Rate this Article :

1

2

3

4

5

6

7

8

9

10
Poor Excellent


Discuss this article with others in our new hosting forums

Comments / Feedback

Jason Ruyle
I'm trying to manually setup my name servers. But I dont know how they should look in: /etc/wwwacct.conf and /etc/nameserverips Could you make a general format? Thanks.
Ramprage
Article updated
Curtis
Awesome! Walked me thru it step by step. Thanks!
tony
Thanks
roy
I can't seem to find Initial NameServer Setup from the Server Setup menu on the left of WHM.
janitor
great
monkeygirl
thanks for the info!
Charlie
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.

When I typed /etc/resolv.conf I would get a message 'Permission Denied'. Seemed that typing 'cat /etc/resolv.conf' solved this problem.
Charlie
To output the resolv.conf you must type

'cat /etc/resolv.conf'

To edit resolv.conf use pico / type:

'pico /etc/resolv.conf'

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.
Charlie
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:

http://www.webhostingtalk.com/showthread.php?threadid=253245
Gabidi
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:

"IP=205.209.141.21 Bind reloading on orion using rndc zone: [gsmliberty.com] 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"

Any ideas ?
Tong Narak
/etc/resolv.conf

I think these should be
Datacenter DNS.


------------------------------------

Resolver Setup
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.
Martyn
Re: Tong Narak

You are correct, these IP addresses should be the ones provided by your host, they are internal and point to your internal DNS resolvers.
Joe A
This is the first time I've ever seen a comprehensive explanation of how to do this. Thank you.
josh
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?
Aziz
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.
alberto
4. Reverse DNS
You may also need to get your data centre to enter a reverse DNS pointer for your nameserv.....

ALLL OK BUT STEP 4.. what i have to do here? contact with my ISP?

thank you!
David K. Tucker
Truly appreciate the help. Set my ATJEU.COM dedicated nameservers up in no time :-) Really appreciate it.

--DAVE
Sparky
Great tutorial - one problem though - dns server appears to work, but now doing a hostname lookup to hosts outside of the server (to yahoo.com, for example) fails.

Hostname lookups to hosts on the dns server work fine, just cannot see any hosts outside of the server.

/etc/resolv.conf looks like:

domain mydomain.com
search mydomain.com
nameserver x.x.x.x
nameserver x.x.x.x

Any thoughts?
Koh Kok Yew
To Gabidi:

To fix this issue you may try running `/scripts/fixndc`
ZeRoo!
thank you!
Deni Wibowo
I have same problem on named failure.
I just removing them an then reinstall using yum.

#yum remove bind
#yum install bind bind-chroot bind-devel caching-nameserver

and then restarting bind

#service named start

and done.
Dr Tokunboh
this is kind of difficult. i dont think i can handle ssh - what can i do?

 Add Comment
Name
Email
Image Code
Refresh Image

Comments / Feedback



Web Hosting News RSS ?


WebHostGear Hire an Expert - NEW!
Let us improve your servers performance, find that spammer and take care of that kernel upgrade. Hire us to help with any tutorials listed on the site or any other services needed. Get your free, NO obligation quote now

Our site offers free hosting tutorials, cpanel tutorial, web hosting news, shell commands, running a web hosting business, dedicated guides, linux tutorial, apache install, home web server, web server guide, ssh commands, dedicated servers, DNS nameservers, chkrootkit, apf firewall, exim configuration, server compromised, cron backup solution, ftp backup script

Server Tutorials


WebHostGear Reviewed by Ping Zine - Click here

Special Offer:


Links:
cPanel server administration

MidPhase Coupons

Reseller Hosting

Reseller Hosting FAQ

Icon

Web Hosting

Datacenter Discussion Forum

Lunarpages Coupon

Hosting Coupon



WebhostGear Sponsors
Going Up Advertise Hosting Free Uptime Check Web Hosting Chat Icons Banners Mall