歡迎您光臨本站 註冊首頁

誰才是權威名字伺服器?

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

誰才是權威名字伺服器?

像以下這個域名

A.DNS.cn返回的ns記錄是ns1.dgnet.net  ns2.dgnet.net
ns2.dgnet.net返回的ns記錄為ns.aristar.com.cn.

誰才是aristar.com.cn的權威名字伺服器?





#  dig aristar.com.cn  +trace

; <<>> DiG 9.5.1-P1 <<>> aristar.com.cn +trace
;; global options:  printcmd
.                       425567  IN      NS      M.ROOT-SERVERS.NET.
.                       425567  IN      NS      H.ROOT-SERVERS.NET.
.                       425567  IN      NS      K.ROOT-SERVERS.NET.
.                       425567  IN      NS      I.ROOT-SERVERS.NET.
.                       425567  IN      NS      E.ROOT-SERVERS.NET.
.                       425567  IN      NS      F.ROOT-SERVERS.NET.
.                       425567  IN      NS      A.ROOT-SERVERS.NET.
.                       425567  IN      NS      B.ROOT-SERVERS.NET.
.                       425567  IN      NS      G.ROOT-SERVERS.NET.
.                       425567  IN      NS      J.ROOT-SERVERS.NET.
.                       425567  IN      NS      D.ROOT-SERVERS.NET.
.                       425567  IN      NS      L.ROOT-SERVERS.NET.
.                       425567  IN      NS      C.ROOT-SERVERS.NET.
;; Received 488 bytes from 127.0.0.1#53(127.0.0.1) in 8 ms

cn.                     172800  IN      NS      D.DNS.cn.
cn.                     172800  IN      NS      E.DNS.cn.
cn.                     172800  IN      NS      B.DNS.cn.
cn.                     172800  IN      NS      C.DNS.cn.
cn.                     172800  IN      NS      NS.CERNET.NET.
cn.                     172800  IN      NS      A.DNS.cn.
;; Received 295 bytes from 198.41.0.4#53(A.ROOT-SERVERS.NET) in 238 ms

aristar.com.cn.         21600   IN      NS      ns1.dgnet.net.
aristar.com.cn.         21600   IN      NS      ns2.dgnet.net.
;; Received 77 bytes from 203.119.25.1#53(A.DNS.cn) in 41 ms

aristar.com.cn.         86400   IN      A       202.104.170.2
aristar.com.cn.         86400   IN      NS      ns.aristar.com.cn.
;; Received 81 bytes from 202.96.172.198#53(ns2.dgnet.net) in 5 ms

[ 本帖最後由 sosogh 於 2009-7-15 15:00 編輯 ]
《解決方案》

網上有2種說法:
1.Every domain name must be assigned a set of authoritative name servers that are installed in NS records in the parent domain.

http://en.wikipedia.org/wiki/Authoritative_name_server#Authoritative_name_server



2.Defined in RFC 1035. NS RRs appear in two places. Within the zone file, in which case they are authoritative records for the zone's name servers. At the point of delegation for either a subdomain of the zone or in the zone's parent. Thus the zone example.com's parent zone (.com) will contain non-authoritative NS RRs for the zone example.com at its point of delegation and subdomain.example.com will have non-authoritative NS RSS in the zone example.com at its point of delegation.

http://www.zytrax.com/books/dns/ch8/ns.html


從dig aristar.com.cn +nssearch 的執行效果來看  應該是ns.aristar.com.cn
但是俺不明白為什麼ns.aristar.com.cn才是

[ 本帖最後由 sosogh 於 2009-7-15 15:10 編輯 ]
《解決方案》

如果LZ了解域名解析過程就不會由此疑問了。   

首先一個域名的權威伺服器是由該類域名的頂級域伺服器決定的。如CN域名的頂級域域伺服器有這些:

C:\Documents and Settings\Administrator>dig cn. ns

; <<>> DiG 9.3.3 <<>> cn. ns
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1115
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 8

;; QUESTION SECTION:
;cn.                            IN      NS

;; ANSWER SECTION:
cn.                     1609    IN      NS      ns.cernet.net.
cn.                     1609    IN      NS      c.dns.cn.
cn.                     1609    IN      NS      d.dns.cn.
cn.                     1609    IN      NS      a.dns.cn.
cn.                     1609    IN      NS      e.dns.cn.
cn.                     1609    IN      NS      b.dns.cn.

;; ADDITIONAL SECTION:
ns.cernet.net.          50604   IN      A       202.112.0.44
c.dns.cn.               70796   IN      A       203.119.27.1
a.dns.cn.               35816   IN      A       203.119.25.1
a.dns.cn.               35113   IN      AAAA    2001:dc7::1
e.dns.cn.               4773    IN      A       203.119.29.1
b.dns.cn.               70796   IN      A       203.119.26.1
d.dns.cn.               4577    IN      A       203.119.28.1
d.dns.cn.               80594   IN      AAAA    2001:dc7:1000::1

;; Query time: 46 msec
;; SERVER: 202.99.166.4#53(202.99.166.4)
;; WHEN: Thu Jul 16 07:24:08 2009
;; MSG SIZE  rcvd: 283


這時要查詢一個域名的權威伺服器,只要到這些頂級域伺服器上查詢即可:

C:\Documents and Settings\Administrator>dig @a.dns.cn aidns.cn ns

; <<>> DiG 9.3.3 <<>> @a.dns.cn aidns.cn ns
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1940
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 3, ADDITIONAL: 3

;; QUESTION SECTION:
;aidns.cn.                      IN      NS

;; AUTHORITY SECTION:
aidns.cn.               21600   IN      NS      ns2.aidns.cn.
aidns.cn.               21600   IN      NS      ns1.aidns.cn.
aidns.cn.               21600   IN      NS      ns3.aidns.cn.

;; ADDITIONAL SECTION:
ns2.aidns.cn.           21600   IN      A       61.55.135.76
ns1.aidns.cn.           21600   IN      A       120.72.34.207
ns3.aidns.cn.           21600   IN      A       219.148.36.19

;; Query time: 62 msec
;; SERVER: 203.119.25.1#53(203.119.25.1)
;; WHEN: Thu Jul 16 07:25:20 2009
;; MSG SIZE  rcvd: 128
《解決方案》

好的  謝謝你

那權威伺服器上的zone文件裡面的針對本域所設置的的NS記錄又有什麼用?
例如上面的:
aristar.com.cn.         86400   IN      NS      ns.aristar.com.cn.
《解決方案》

原帖由 sosogh 於 2009-7-16 10:03 發表 http://bbs2.chinaunix.net/images/common/back.gif
好的  謝謝你

那權威伺服器上的zone文件裡面的針對本域所設置的的NS記錄又有什麼用?
例如上面的:
aristar.com.cn.         86400   IN      NS      ns.aristar.com.cn.


雖然頂級域DNS定義了域名的權威伺服器A,但是最終對該域名作出最終解析的並不一定是A,如果A上又定義了該域名NS為B,則最終解析域名的是B。 這樣處理大大增加了NS記錄配置的靈活性。

還有一個好處,在權威伺服器上配置NS記錄可以實現其子域名由其他DNS負責解析如配置WWW.ABC.COM 的NS為C伺服器。22.ABC.COM的NS伺服器為D伺服器等。

[ 本帖最後由 llzqq 於 2009-7-16 16:17 編輯 ]
《解決方案》

原帖由 llzqq 於 2009-7-16 16:14 發表 http://bbs2.chinaunix.net/images/common/back.gif



雖然頂級域DNS定義了域名的權威伺服器A,但是最終對該域名作出最終解析的並不一定是A,如果A上又定義了該域名NS為B,則最終解析域名的是B。 這樣處理大大增加了NS記錄配置的靈活性。

還有一個好處,在 ...

像例子中的情況
dig aristar.com.cn +trace的時候,怎麼會是由ns1.dgnet.net返回aristar.com.cn的A記錄
而不是ns.aristar.com.cn?





# dig aristar.com.cn +trace

; <<>> DiG 9.5.1-P1 <<>> aristar.com.cn +trace
;; global options:  printcmd
.                       472735  IN      NS      b.root-servers.net.
.                       472735  IN      NS      a.root-servers.net.
.                       472735  IN      NS      k.root-servers.net.
.                       472735  IN      NS      j.root-servers.net.
.                       472735  IN      NS      d.root-servers.net.
.                       472735  IN      NS      f.root-servers.net.
.                       472735  IN      NS      i.root-servers.net.
.                       472735  IN      NS      m.root-servers.net.
.                       472735  IN      NS      e.root-servers.net.
.                       472735  IN      NS      h.root-servers.net.
.                       472735  IN      NS      g.root-servers.net.
.                       472735  IN      NS      c.root-servers.net.
.                       472735  IN      NS      l.root-servers.net.
;; Received 500 bytes from 127.0.0.1#53(127.0.0.1) in 4 ms

cn.                     172800  IN      NS      A.DNS.cn.
cn.                     172800  IN      NS      E.DNS.cn.
cn.                     172800  IN      NS      D.DNS.cn.
cn.                     172800  IN      NS      NS.CERNET.NET.
cn.                     172800  IN      NS      B.DNS.cn.
cn.                     172800  IN      NS      C.DNS.cn.
;; Received 295 bytes from 192.33.4.12#53(c.root-servers.net) in 246 ms

aristar.com.cn.         21600   IN      NS      ns2.dgnet.net.
aristar.com.cn.         21600   IN      NS      ns1.dgnet.net.
;; Received 77 bytes from 202.112.0.44#53(NS.CERNET.NET) in 38 ms

aristar.com.cn.         86400   IN      A       202.104.170.2
aristar.com.cn.         86400   IN      NS      ns.aristar.com.cn.
;; Received 81 bytes from 202.96.172.218#53(ns1.dgnet.net) in 2 ms
《解決方案》

首先明確權威DNS的概念:被頂級域DNS授權進行域名解析的伺服器。
我在5樓已經提到了:
雖然頂級域DNS定義了域名的權威伺服器A,但是最終對該域名作出最終解析的並不一定是A,如果A上又定義了該域名NS為B,則最終解析域名的是B。
這裡遇到的問題正是這種情況:

1.在頂級域上確定權威DNS:
C:\Documents and Settings\Administrator>dig @A.DNS.cn aristar.com.cn ns
; <<>> DiG 9.3.3 <<>> @A.DNS.cn aristar.com.cn ns
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 219
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 0
;; QUESTION SECTION:
;aristar.com.cn.                        IN      NS
;; AUTHORITY SECTION:
aristar.com.cn.         21600   IN      NS      ns2.dgnet.net.
aristar.com.cn.         21600   IN      NS      ns1.dgnet.net.
;; Query time: 15 msec
;; SERVER: 203.119.25.1#53(203.119.25.1)
;; WHEN: Fri Jul 17 06:50:38 2009
;; MSG SIZE  rcvd: 77
2.再看一下權威伺服器是否把該域名解析權轉交給別人了:

C:\Documents and Settings\Administrator>dig @ns2.dgnet.net aristar.com.cn ns
; <<>> DiG 9.3.3 <<>> @ns2.dgnet.net aristar.com.cn ns
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 963
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;aristar.com.cn.                        IN      NS
;; ANSWER SECTION:
aristar.com.cn.         86400   IN      NS      ns.aristar.com.cn.
;; ADDITIONAL SECTION:
ns.aristar.com.cn.      86400   IN      A       202.104.170.2
;; Query time: 62 msec
;; SERVER: 202.96.172.198#53(202.96.172.198)
;; WHEN: Fri Jul 17 06:52:47 2009
;; MSG SIZE  rcvd: 65

很明顯權威DNS(ns2.dgnet.net)把域名解析任何轉交給了ns.aristar.com.cn,這就不難理解為什麼域名是由非權威伺服器解析了
《解決方案》

是的

為什麼查詢 dig ww.aristar.com.cn 的時候,dig不去問ns.aristar.com.cn?
在這裡就斷開?
aristar.com.cn.         86400   IN      SOA     dgnet.com.cn. www.dgnet.com.cn. 1997022700 28800 14400 3600000 86400
;; Received 81 bytes from 202.96.172.218#53(ns1.dgnet.net) in 3 ms







# dig ww.aristar.com.cn +trace

; <<>> DiG 9.5.1-P1 <<>> ww.aristar.com.cn +trace
;; global options:  printcmd
.                       428257  IN      NS      h.root-servers.net.
.                       428257  IN      NS      m.root-servers.net.
.                       428257  IN      NS      k.root-servers.net.
.                       428257  IN      NS      a.root-servers.net.
.                       428257  IN      NS      b.root-servers.net.
.                       428257  IN      NS      f.root-servers.net.
.                       428257  IN      NS      d.root-servers.net.
.                       428257  IN      NS      i.root-servers.net.
.                       428257  IN      NS      c.root-servers.net.
.                       428257  IN      NS      l.root-servers.net.
.                       428257  IN      NS      j.root-servers.net.
.                       428257  IN      NS      e.root-servers.net.
.                       428257  IN      NS      g.root-servers.net.
;; Received 500 bytes from 127.0.0.1#53(127.0.0.1) in 3 ms

cn.                     172800  IN      NS      a.dns.cn.
cn.                     172800  IN      NS      b.dns.cn.
cn.                     172800  IN      NS      c.dns.cn.
cn.                     172800  IN      NS      d.dns.cn.
cn.                     172800  IN      NS      e.dns.cn.
cn.                     172800  IN      NS      ns.cernet.net.
;; Received 298 bytes from 199.7.83.42#53(l.root-servers.net) in 168 ms

aristar.com.cn.         21600   IN      NS      ns2.dgnet.net.
aristar.com.cn.         21600   IN      NS      ns1.dgnet.net.
;; Received 80 bytes from 203.119.25.1#53(a.dns.cn) in 42 ms

aristar.com.cn.         86400   IN      SOA     dgnet.com.cn. www.dgnet.com.cn. 1997022700 28800 14400 3600000 86400
;; Received 81 bytes from 202.96.172.218#53(ns1.dgnet.net) in 3 ms

[ 本帖最後由 sosogh 於 2009-7-17 10:43 編輯 ]
《解決方案》

原帖由 sosogh 於 2009-7-17 09:35 發表 http://bbs2.chinaunix.net/images/common/back.gif
是的

為什麼查詢 dig ww.aristar.com.cn 的時候,dig不去問ns.aristar.com.cn?
在這裡就斷開?
aristar.com.cn.         86400   IN      SOA     dgnet.com.cn. www.dgnet.com.cn. 1997022700 28800 144 ...

ns.aristar.com.cn工作正常嗎?down了吧!另外提醒一下:nsx.dgnet.net上soa記錄的配置也不規範。

aristar.com.cn.         86400   IN      SOA     dgnet.com.cn. www.dgnet.com.cn. 1997022700 28800 144 ...

----》改為:

aristar.com.cn.         86400   IN      SOA     1.   2.      1997022700 28800 144 ...

1.這裡為ns1.dgnet.net.
2.這裡為管理員郵箱,如郵箱為box@abc.com ,在這裡應寫為:box.abc.com.

[ 本帖最後由 llzqq 於 2009-7-17 15:45 編輯 ]
《解決方案》

好的  THX

[火星人 ] 誰才是權威名字伺服器?已經有676次圍觀

http://coctec.com/docs/service/show-post-21635.html