Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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
add comment

3 Answers

up vote 1 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
Server:         1.2.3.4
Address:        1.2.3.4

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 = 192.35.51.30
k.gtld-servers.net      internet address = 192.52.178.30
h.gtld-servers.net      internet address = 192.54.112.30
b.gtld-servers.net      internet address = 192.33.14.30
b.gtld-servers.net      has AAAA address 2001:503:231d::2:30
l.gtld-servers.net      internet address = 192.41.162.30
d.gtld-servers.net      internet address = 192.31.80.30
i.gtld-servers.net      internet address = 192.43.172.30
j.gtld-servers.net      internet address = 192.48.79.30
g.gtld-servers.net      internet address = 192.42.93.30
e.gtld-servers.net      internet address = 192.12.94.30
m.gtld-servers.net      internet address = 192.55.83.30
c.gtld-servers.net      internet address = 192.26.92.30
a.gtld-servers.net      internet address = 192.5.6.30
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
Address:        192.33.14.30#53

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 = 199.43.132.53
a.iana-servers.net      has AAAA address 2001:500:8c::53
b.iana-servers.net      internet address = 199.43.133.53
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.
Address:        199.43.132.53#53

Name:   example.com
Address: 192.0.43.10
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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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