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.

When does the NS lookup chain stop?

For example, if I go to A.com and the NS for A.com is ns.B.com.

Then the client (browser) needs to find out the IP for B.com, NS for B.com is ns.C.com.

Then the client needs to find out the IP for C.com, NS for C.com is ns.D.com.

Then the client needs to find out the IP for D.com, NS for D.com is ns.E.com..

I mean where does this chain stop exactly?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Generally speaking the NS records are stored as glue. So when you go to a.com you go to the root (*.root-servers.net) which are hardcoded into your dns servers. In the case of .com you then get pointed at *.gtld-servers.net which host the .com tld. From there you would be given the NS records for a.com along with the IP addresses due to the glue records. Here is an example of looking for google..

  [~] dig +trace google.com 

; <<>> DiG 9.7.3 <<>> +trace google.com
;; global options: +cmd
.           321319  IN  NS  k.root-servers.net.
.           321319  IN  NS  c.root-servers.net.
.           321319  IN  NS  l.root-servers.net.
.           321319  IN  NS  g.root-servers.net.
.           321319  IN  NS  j.root-servers.net.
.           321319  IN  NS  f.root-servers.net.
.           321319  IN  NS  d.root-servers.net.
.           321319  IN  NS  h.root-servers.net.
.           321319  IN  NS  a.root-servers.net.
.           321319  IN  NS  m.root-servers.net.
.           321319  IN  NS  e.root-servers.net.
.           321319  IN  NS  b.root-servers.net.
.           321319  IN  NS  i.root-servers.net.
;; Received 512 bytes from 10.10.0.1#53(10.10.0.1) in 7 ms

com.            172800  IN  NS  g.gtld-servers.net.
com.            172800  IN  NS  m.gtld-servers.net.
com.            172800  IN  NS  a.gtld-servers.net.
com.            172800  IN  NS  f.gtld-servers.net.
com.            172800  IN  NS  b.gtld-servers.net.
com.            172800  IN  NS  i.gtld-servers.net.
com.            172800  IN  NS  h.gtld-servers.net.
com.            172800  IN  NS  k.gtld-servers.net.
com.            172800  IN  NS  e.gtld-servers.net.
com.            172800  IN  NS  l.gtld-servers.net.
com.            172800  IN  NS  d.gtld-servers.net.
com.            172800  IN  NS  j.gtld-servers.net.
com.            172800  IN  NS  c.gtld-servers.net.
;; Received 488 bytes from 192.5.5.241#53(f.root-servers.net) in 35 ms

google.com.     172800  IN  NS  ns2.google.com.
google.com.     172800  IN  NS  ns1.google.com.
google.com.     172800  IN  NS  ns3.google.com.
google.com.     172800  IN  NS  ns4.google.com.
;; Received 164 bytes from 192.26.92.30#53(c.gtld-servers.net) in 40 ms

google.com.     300 IN  A   72.14.204.105
google.com.     300 IN  A   72.14.204.103
google.com.     300 IN  A   72.14.204.99
google.com.     300 IN  A   72.14.204.147
google.com.     300 IN  A   72.14.204.104
;; Received 108 bytes from 216.239.36.10#53(ns3.google.com) in 124 ms

The address of ns3.google.com was obtained from the gtld-server returned in the additional section.

[~] dig @c.gtld-servers.net ns3.google.com       

; <<>> DiG 9.7.3 <<>> @c.gtld-servers.net ns3.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62420
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 4, ADDITIONAL: 4
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;ns3.google.com.            IN  A

;; AUTHORITY SECTION:
google.com.     172800  IN  NS  ns2.google.com.
google.com.     172800  IN  NS  ns1.google.com.
google.com.     172800  IN  NS  ns3.google.com.
google.com.     172800  IN  NS  ns4.google.com.

;; ADDITIONAL SECTION:
ns2.google.com.     172800  IN  A   216.239.34.10
ns1.google.com.     172800  IN  A   216.239.32.10
ns3.google.com.     172800  IN  A   216.239.36.10
ns4.google.com.     172800  IN  A   216.239.38.10

;; Query time: 44 msec
;; SERVER: 192.26.92.30#53(192.26.92.30)
;; WHEN: Sat Sep 24 10:04:56 2011
;; MSG SIZE  rcvd: 164
share|improve this answer

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.