3

I am attempting to use bind9 on my linux VPS to "host" the zone files for my domain name. My confusion is that my VPS's hostname is that domain name. If a client were to look up ns1.mydomain.com and my VPS is serving that zone file, the client would never be able to access the zone file of example.com to solve ns1.example.com.

So here's my question: Is it acceptable to use an IP Address in a domain name's "Nameserver" field instead of a domain name? I've never seen it done before and I am wondering if there is a reason for that.

  • I think [this Q&A](http://serverfault.com/q/309622/126632) and [this one](http://serverfault.com/q/355887/126632) cover everything you need to know. Primarily the latter. – Michael Hampton Jul 29 '14 at 03:17

1 Answers1

6

No, you cannot just use the IP address as a nameserver.

To solve the apparent chicken-vs-egg problem, you need glue records inserted into the parent zone. For example.com., the parent zone would be .com. Your registrar must do this..

So, lets say for sake of argument that your VPS's IP address is 10.1.2.3, and you've got a secondary nameserver running on 192.168.168.192..

In your zone file served up by bind, you might have something like this.

example.com. IN A 10.1.2.3
example.com. IN NS ns1.domain.com.
example.com. IN NS ns2.domain.com.
ns1.example.com. IN A 10.1.2.3
ns2.example.com. IN A 192.168.168.192

Then, in addition to providing your registrar with ns1.example.com. and ns2.example.com. as the nameservers, you will need to provide the registrar with IP addresses that correspond to those nameservers. The registrar will then pass that info on to the registry.

Verisign (they operate .com) will then have in their zone file, ie the .com, zone file:

example.com. IN NS ns1.example.com.
example.com. IN NS ns2.example.com.
ns1.example.com. IN A 10.1.2.3
ns2.example.com. IN A 192.168.168.192

with no other entries for example.com. (unless you add more nameservers, or add DNSSEC in which case they would have DS records in the parent zone)

The A records in the parent zone are called "glue records" and they solve the chicken vs egg issue.

Joe Sniderman
  • 2,749
  • 1
  • 21
  • 26
  • That explains it! I will have to contact GoDaddy once I get the bind9 server up. Thanks for the great description! –  Jul 29 '14 at 03:24
  • GoDaddy has the option in their control panel to set nameservers for the domain. – Tero Kilkanen Jul 29 '14 at 05:25