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.

Quick question about the DNS protocol, which I didn't really understand. Let's take a website, say google.com. I type the address in my browser.

The DNS resolver will check the root servers, the GTLD servers. Which will say, if I understand well, "hey, check nsX.google.com to get your answer".

But in that case, how does the resolver know the IP for nsX.google.com, if the answer is held by the nsX.google.com servers themselves ?

disco:~ Disco$ dig +trace ns1.google.com

; <<>> DiG 9.6.0-APPLE-P2 <<>> +trace ns1.google.com
;; global options: +cmd
.           50181   IN  NS  j.root-servers.net.
[...]
.           50181   IN  NS  a.root-servers.net.
;; Received 449 bytes from 192.168.1.1#53(192.168.1.1) in 55 ms

com.            172800  IN  NS  a.gtld-servers.net.
[...]
com.            172800  IN  NS  m.gtld-servers.net.
;; Received 495 bytes from 199.7.83.42#53(l.root-servers.net) in 165 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.31.80.30#53(d.gtld-servers.net) in 219 ms

ns1.google.com.     345600  IN  A   216.239.32.10
;; Received 48 bytes from 216.239.32.10#53(ns1.google.com) in 70 ms

Thanks.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

This apparent cyclic dependency is resolved by using what are known as "glue" records.

See this answer.

share|improve this answer

You have authoritative servers (on which the zones are defined) but root servers know which domains are registered on which servers.

In short, you get the "where is ns1.google.com" from a.gtld-servers.net:

$ dig @a.gtld-servers.net. ns1.google.com

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

;; QUESTION SECTION:
;ns1.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: 139 msec
;; SERVER: 192.5.6.30#53(192.5.6.30)
;; WHEN: Tue Oct 19 09:39:25 2010
;; MSG SIZE  rcvd: 164
share|improve this answer
    
Thanks a lot for your help :) –  Pierre Oct 19 '10 at 7:43

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.