NS 查找链在哪里停止?

NS 查找链在哪里停止?

NS 查找链何时停止?

例如,如果我前往 ,A.com并且 的 NSA.comns.B.com

然后客户端(浏览器)需要找出 的IP B.com, 的NSB.comns.C.com

然后客户端需要找出 的IP C.com, 的NSC.comns.D.com

然后客户端需要找出的IP D.com,的NSD.comns.E.com..

我的意思是这条链条到底在哪里停止?

答案1

一般来说,NS 记录以胶水形式存储。因此,当您转到时,a.com您将转到根 (*.root-servers.net),该根被硬编码到您的 dns 服务器中。对于 .com,您将被指向托管 .com tld 的 *.gtld-servers.net。从那里,您将获得 NS 记录以及a.com胶水记录提供的 IP 地址。以下是搜索 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

ns3.google.com的地址是从附加部分返回的gtld-server中获取的。

[~] 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

相关内容