介绍dns的原理的资料很多,不过很多都比较难懂,而且无法看到实际的效果,希望看完能帮助你理解
介绍dns的原理的资料很多,不过很多都比较难懂,而且无法看到实际的效果,希望看完能帮助你理解。
现在已经有dig的windos版本
http://www.chinaunix.net/jh/16/310139.html
从根服务器开始追踪一个域名的解析过程 dig winmag.com.cn +trace
[root@ns01 /]# dig winmag.com.cn +trace
; <<>> DiG 9.2.4 <<>> winmag.com.cn +trace
;; global options: printcmd
. 511849 IN NS b.root-servers.net.
. 511849 IN NS c.root-servers.net.
. 511849 IN NS d.root-servers.net.
. 511849 IN NS e.root-servers.net.
. 511849 IN NS f.root-servers.net.
. 511849 IN NS g.root-servers.net.
. 511849 IN NS h.root-servers.net.
. 511849 IN NS i.root-servers.net.
. 511849 IN NS j.root-servers.net.
. 511849 IN NS k.root-servers.net.
. 511849 IN NS l.root-servers.net.
. 511849 IN NS m.root-servers.net.
. 511849 IN NS a.root-servers.net.
;; Received 420 bytes from 192.168.0.10#53(192.168.0.10) in 9 ms
cn. 172800 IN NS NS.CNC.AC.cn.
cn. 172800 IN NS DNS2.CNNIC.NET.cn.
cn. 172800 IN NS NS.CERNET.NET.
cn. 172800 IN NS DNS3.CNNIC.NET.cn.
cn. 172800 IN NS DNS4.CNNIC.NET.cn.
cn. 172800 IN NS DNS5.CNNIC.NET.cn.
;; Received 320 bytes from 192.228.79.201#53(b.root-servers.net) in 225 ms
com.cn. 172800 IN NS sld-ns2.cnnic.net.cn.
com.cn. 172800 IN NS sld-ns3.cnnic.net.cn.
com.cn. 172800 IN NS sld-ns4.cnnic.net.cn.
com.cn. 172800 IN NS sld-ns5.cnnic.net.cn.
com.cn. 172800 IN NS cns.cernet.net.
com.cn. 172800 IN NS sld-ns1.cnnic.net.cn.
;; Received 275 bytes from 159.226.1.1#53(NS.CNC.AC.cn) in 16 ms
winmag.com.cn. 43200 IN NS ns1.xconnected.com.
winmag.com.cn. 43200 IN NS ns2.xconnected.com.
;; Received 81 bytes from 202.97.16.197#53(sld-ns2.cnnic.net.cn) in 123 ms
winmag.com.cn. 3600 IN A 61.152.144.156
;; Received 47 bytes from 61.152.251.26#53(ns1.xconnected.com) in 81 ms
再看一个例子
[root@ns01 /]# dig chinaunix.net +trace
; <<>> DiG 9.2.4 <<>> chinaunix.net +trace
;; global options: printcmd
. 511322 IN NS b.root-servers.net.
. 511322 IN NS c.root-servers.net.
. 511322 IN NS d.root-servers.net.
. 511322 IN NS e.root-servers.net.
. 511322 IN NS f.root-servers.net.
. 511322 IN NS g.root-servers.net.
. 511322 IN NS h.root-servers.net.
. 511322 IN NS i.root-servers.net.
. 511322 IN NS j.root-servers.net.
. 511322 IN NS k.root-servers.net.
. 511322 IN NS l.root-servers.net.
. 511322 IN NS m.root-servers.net.
. 511322 IN NS a.root-servers.net.
;; Received 420 bytes from 192.168.0.10#53(192.168.0.10) in 9 ms
net. 172800 IN NS A.GTLD-SERVERS.net.
net. 172800 IN NS G.GTLD-SERVERS.net.
net. 172800 IN NS H.GTLD-SERVERS.net.
net. 172800 IN NS C.GTLD-SERVERS.net.
net. 172800 IN NS I.GTLD-SERVERS.net.
net. 172800 IN NS B.GTLD-SERVERS.net.
net. 172800 IN NS D.GTLD-SERVERS.net.
net. 172800 IN NS L.GTLD-SERVERS.net.
net. 172800 IN NS F.GTLD-SERVERS.net.
net. 172800 IN NS J.GTLD-SERVERS.net.
net. 172800 IN NS K.GTLD-SERVERS.net.
net. 172800 IN NS E.GTLD-SERVERS.net.
net. 172800 IN NS M.GTLD-SERVERS.net.
;; Received 500 bytes from 192.228.79.201#53(b.root-servers.net) in 226 ms
chinaunix.net. 172800 IN NS dns1.hichina.com.
chinaunix.net. 172800 IN NS dns2.hichina.com.
;; Received 112 bytes from 192.5.6.30#53(A.GTLD-SERVERS.net) in 387 ms
chinaunix.net. 10800 IN A 61.135.136.122
chinaunix.net. 10800 IN NS dns1.hichina.com.
chinaunix.net. 10800 IN NS dns2.hichina.com.
;; Received 128 bytes from 218.244.135.40#53(dns2.hichina.com) in 9 ms
在看一个例子,可能会改变大家认识,cn的是顶级域名,是中国的,但是它的解释好像还是要通过国外,
[root@ns01 /]# dig blogit.cn +trace
; <<>> DiG 9.2.4 <<>> blogit.cn +trace
;; global options: printcmd
. 504692 IN NS m.root-servers.net.
. 504692 IN NS a.root-servers.net.
. 504692 IN NS b.root-servers.net.
. 504692 IN NS c.root-servers.net.
. 504692 IN NS d.root-servers.net.
. 504692 IN NS e.root-servers.net.
. 504692 IN NS f.root-servers.net.
. 504692 IN NS g.root-servers.net.
. 504692 IN NS h.root-servers.net.
. 504692 IN NS i.root-servers.net.
. 504692 IN NS j.root-servers.net.
. 504692 IN NS k.root-servers.net.
. 504692 IN NS l.root-servers.net.
;; Received 420 bytes from 192.168.0.10#53(192.168.0.10) in 9 ms
cn. 172800 IN NS NS.CNC.AC.cn.
cn. 172800 IN NS DNS2.CNNIC.NET.cn.
cn. 172800 IN NS NS.CERNET.NET.
cn. 172800 IN NS DNS3.CNNIC.NET.cn.
cn. 172800 IN NS DNS4.CNNIC.NET.cn.
cn. 172800 IN NS DNS5.CNNIC.NET.cn.
;; Received 316 bytes from 202.12.27.33#53(m.root-servers.net) in 526 ms
blogit.cn. 43200 IN NS ns.xinnet.cn.
blogit.cn. 43200 IN NS ns.xinnetdns.com.
;; Received 97 bytes from 159.226.1.1#53(NS.CNC.AC.cn) in 12 ms
blogit.cn. 3600 IN A 202.103.69.217
;; Received 43 bytes from 202.106.124.195#53(ns.xinnet.cn) in 5013 ms