3

Domain name: abc.com Name Server: ns1.abc.com and ns2.abc.com

I am running a DNS server and hosting the zone (abc.com) on-premise.

When a client wants to resolve *.abc.com, it will query ns1.abc.com or ns2.abc.com, that is straight forward.

The question is how does it resolve ns1.abc.com before it can sends query to it?

Leon
  • 41
  • 2

3 Answers3

2

To find the name server for abc.com a DNS server will query the DNS server for com. This will return the nameserver information provided to your registrar. You must provide the IP addresses to the registrar when the servers are within your domain.

To find the com DNS servers the DNS server will contact one of the root domain servers. When the DNS server starts it will use a hints file to do an initial lookup of the root servers.

BillThor
  • 27,354
  • 3
  • 35
  • 69
  • it's obvious with IP address, but not clear with domain name, e.g. how DNS resolve ns1.example.com, if it's under example.com which DNS is ns1.example.com – Alex Ivasyuv Mar 18 '17 at 12:48
  • @AlexIvasyuv The server for `.com` will return the `NS` records for `example.com` which would be `ns1.example.com`, and include the `A` records for servers. One of those servers would be queried for the `A` record for `example.com`. – BillThor Mar 18 '17 at 23:20
-1

you assign DNS servers on clients when configuring IP, so each client already have the ip addresses of DNS servers. and on your DNS servers there are NS records for your name servers.

-1

You should never specify a name server by name, only by IP. So you wouldn't tell the DNS client to talk to ns1.abc.com, you'd tell the client to talk to it's ns1.abc.com's IP.

For the top level DNS servers, a "hints" file is, or used to be, used to tell the client of the top level DNS servers.

user1174838
  • 616
  • 5
  • 18
  • if that's the case, google.com setup is wrong? since they are pointing to ns1.google.com etc etc... – Leon Apr 20 '16 at 03:23
  • 1
    Incorrect. The standard only allows `NS` records to refer to nameservers by name, not IP address, and [it was designed that way for a reason](http://serverfault.com/a/764957/152073). – Andrew B Apr 20 '16 at 03:28
  • Thanks for the correction guys, so the answer then is "A records are used to resolve the names in the NS records"? – user1174838 Apr 20 '16 at 04:10
  • It's a mixture. `NS` records point at `A` records. When defining the domain itself though, it is frequently necessary to use [glue records](http://serverfault.com/questions/309622/what-is-a-glue-record) as you otherwise end up with chicken and egg scenarios. (`example.com` defining nameservers inside of its own domain, ala `ns1.example.com`) They should be avoided unless absolutely necessary. – Andrew B Apr 20 '16 at 04:20