Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a cloud server with CentOs 6.2 and cPanel installed.

I want to set up my own nameservers with my domain.

My hostname is: something.mydomain.com

I changed the A-records on ns1.mydomain.com to my IP1 I changed the A-records on ns2.mydomain.com to my IP2

I did the set up via cPanel using BIND and used IP1 on ns1 and IP2 on ns2.

I opened port 53 on my server.

But it doesn't work. Have I missed something?

share|improve this question

closed as off-topic by Hyppy, masegaloeh, mdpc, Sven May 2 at 8:18

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

up vote 2 down vote accepted

I think most of us on this site configure things directly in BIND, so it may be challenging to answer your question. If you're familiar at all with the command line interface, you should post your config files. If not, I would suggest at least giving us screenshots of your CPanel windows that relate.

The nslookup and dig commands are handy for verifying what is going on. The commands work by specifying flags (-option=value), then the domain you're searching followed by the domain server you want to ask. In the first one, I don't specify a domain server so it just used my local default server. For example using example.com:

Select a TLD server to query

First, we need to find an authoritative nameserver from com. to ask. Pick one of these servers as the reference for your next query. You'll see in the next section that I chose b.gtld-servers.net.

$ nslookup -query=NS com

Non-authoritative answer:
com     nameserver = f.gtld-servers.net.
com     nameserver = k.gtld-servers.net.
com     nameserver = h.gtld-servers.net.
com     nameserver = b.gtld-servers.net.
com     nameserver = l.gtld-servers.net.
com     nameserver = d.gtld-servers.net.
com     nameserver = i.gtld-servers.net.
com     nameserver = j.gtld-servers.net.
com     nameserver = g.gtld-servers.net.
com     nameserver = e.gtld-servers.net.
com     nameserver = m.gtld-servers.net.
com     nameserver = c.gtld-servers.net.
com     nameserver = a.gtld-servers.net.

Authoritative answers can be found from:
f.gtld-servers.net      internet address =
k.gtld-servers.net      internet address =
h.gtld-servers.net      internet address =
b.gtld-servers.net      internet address =
b.gtld-servers.net      has AAAA address 2001:503:231d::2:30
l.gtld-servers.net      internet address =
d.gtld-servers.net      internet address =
i.gtld-servers.net      internet address =
j.gtld-servers.net      internet address =
g.gtld-servers.net      internet address =
e.gtld-servers.net      internet address =
m.gtld-servers.net      internet address =
c.gtld-servers.net      internet address =
a.gtld-servers.net      internet address =
a.gtld-servers.net      has AAAA address 2001:503:a83e::2:30

Verify the nameserver for your domain is what you expect

Here, we see that a.iana-servers.net. and b.iana-servers.net. are the name servers of record.

$ nslookup -query=NS example.com b.gtld-servers.net
Server:         b.gtld-servers.net

Non-authoritative answer:
*** Can't find example.com: No answer

Authoritative answers can be found from:
example.com     nameserver = a.iana-servers.net.
example.com     nameserver = b.iana-servers.net.
a.iana-servers.net      internet address =
a.iana-servers.net      has AAAA address 2001:500:8c::53
b.iana-servers.net      internet address =
b.iana-servers.net      has AAAA address 2001:500:8d::53

Verify that your nameserver is returning the address you expect

Once we know the right name, check that it is accessible and giving us the right answers.

$ nslookup -query=A example.com a.iana-servers.net.

Server:         a.iana-servers.net.

Name:   example.com
share|improve this answer
Thank you very much for your answer. When I do i nslookup on one of my domains I have updated with the nameserver I get this message: DNS request timed out. timeout was 2 seconds. Even though I hav updated the nameservers several days ago. –  Anders Mar 5 '12 at 15:27
@Anders which nameserver is timing out? If it is your nameserver, it is probably an accessibility or "is it running" issue. –  Jeff Ferland Mar 5 '12 at 15:29
It's my nameservers. –  Anders Mar 10 '12 at 19:17
Thank you very much for your help. I didn't open the correct ports to run a nameserver, this is the reason it didn't work. –  Anders Jun 2 '12 at 0:36

What you need to do is contact your domain registrar, and have them switch the glue records for ns1.mydomain.com and ns2.mydomain.com to your new IP addreses. The glue records prevent the following from happening:

  • Client asks the com nameservers what nameservers to use for mydomain.com
  • The com nameservers respond with ns1.mydomain.com and ns2.mydomain.com
  • The client has no way to determine what those are, as it would ask the domain servers for mydomain.com what ns1 and ns2 are (but it doesn't know what those are until it knows what ns1 and ns2 are)

The glue records are sent by the com nameservers when someone asks for the NS records for mydomain.com. Currently, these likely point at your old DNS server, so clients are contacting them for all their requests.

share|improve this answer

You can refer to this howto on How to Setup Private DNS With Bind9 Chroot on CentOS 6.2 VPS.

You can compare all your steps. In this article, the followings steps has been configured :

  • Forwarding named server in Bind Chroot server.
  • There is one sample zone record ehowstuff.local, please replace with your domain.
  • Redundant nameservers(ns1,ns2) which consist Master/Slave and slave is allowed to download Master' zone
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.