Windows下的dig命令
[ 2009/06/25 14:24 | by selboo ]
windows下的dig命令
解压到 system32 目录下
直接在cmd下 使用 如
dig @202.106.0.20 selboo.com.cn
dig 使用参考 http://selboo.com.cn/post/454
解压到 system32 目录下
直接在cmd下 使用 如
dig @202.106.0.20 selboo.com.cn
dig 使用参考 http://selboo.com.cn/post/454
下载文件 (已下载 270 次)
>dig sina.com.cn //查询A记录
;; QUESTION SECTION:
;sina.com.cn. IN A
;; ANSWER SECTION:
sina.com.cn. 37 IN A 202.108.33.32
>dig sina.com.cn ns //查询NS记录
;; QUESTION SECTION:
;sina.com.cn. IN NS
;; ANSWER SECTION:
sina.com.cn. 21478 IN NS ns2.sina.com.cn.
sina.com.cn. 21478 IN NS ns3.sina.com.cn.
sina.com.cn. 21478 IN NS ns1.sina.com.cn.
>dig sina.com.cn soa //查询SOA记录
;; QUESTION SECTION:
;sina.com.cn. IN SOA
;; ANSWER SECTION:
sina.com.cn. 600 IN SOA ns1.sina.com.cn. senjin.staff.sina.com.cn. 5 1800 600 604801 600
另外,还可以
dig @Server sina.com.cn. //在Server服务器上查询sina.com.cn的记录,比如
>dig @210.51.191.22 sina.com.cn
;; QUESTION SECTION:
;sina.com.cn. IN A
;; AUTHORITY SECTION:
sina.com.cn. 21600 IN NS ns1.sina.com.cn.
sina.com.cn. 21600 IN NS ns2.sina.com.cn.
sina.com.cn. 21600 IN NS ns3.sina.com.cn.
;; ADDITIONAL SECTION:
ns1.sina.com.cn. 21600 IN A 202.106.184.166
ns2.sina.com.cn. 21600 IN A 61.172.201.254
ns3.sina.com.cn. 21600 IN A 202.108.44.55
# 查找一个域的授权 dns 服务器
dig sina.com.cn. +nssearch
SOA ns1.sina.com.cn. senjin.staff.sina.com.cn. 5 1800 600 604801 600 from server ns1.sina.com.cn in 31 ms.
SOA ns1.sina.com.cn. senjin.staff.sina.com.cn. 5 1800 600 604801 600 from server ns3.sina.com.cn in 31 ms.
SOA ns1.sina.com.cn. senjin.staff.sina.com.cn. 5 1800 600 604801 600 from server ns2.sina.com.cn in 46 ms.
# 从根服务器开始追踪一个域名的解析过程
>dig news.sina.com.cn +trace
;; global options: printcmd
. 518138 IN NS A.ROOT-SERVERS.NET.
. 518138 IN NS B.ROOT-SERVERS.NET.
. 518138 IN NS C.ROOT-SERVERS.NET.
. 518138 IN NS D.ROOT-SERVERS.NET.
. 518138 IN NS E.ROOT-SERVERS.NET.
. 518138 IN NS F.ROOT-SERVERS.NET.
. 518138 IN NS G.ROOT-SERVERS.NET.
. 518138 IN NS H.ROOT-SERVERS.NET.
. 518138 IN NS I.ROOT-SERVERS.NET.
. 518138 IN NS J.ROOT-SERVERS.NET.
. 518138 IN NS K.ROOT-SERVERS.NET.
. 518138 IN NS L.ROOT-SERVERS.NET.
. 518138 IN NS M.ROOT-SERVERS.NET.
;; Received 228 bytes from 192.168.1.1#53(192.168.1.1) in 15 ms
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.
cn. 172800 IN NS A.DNS.cn.
cn. 172800 IN NS B.DNS.cn.
;; Received 297 bytes from 198.41.0.4#53(A.ROOT-SERVERS.NET) in 281 ms
sina.com.cn. 21600 IN NS ns3.sina.com.cn.
sina.com.cn. 21600 IN NS ns1.sina.com.cn.
sina.com.cn. 21600 IN NS ns2.sina.com.cn.
;; Received 136 bytes from 203.119.29.1#53(E.DNS.cn) in 171 ms
news.sina.com.cn. 60 IN CNAME jupiter.sina.com.cn.
jupiter.sina.com.cn. 60 IN CNAME hydra.sina.com.cn.
hydra.sina.com.cn. 60 IN A 218.30.108.61
hydra.sina.com.cn. 60 IN A 218.30.108.62
hydra.sina.com.cn. 60 IN A 218.30.108.63
hydra.sina.com.cn. 60 IN A 218.30.108.64
hydra.sina.com.cn. 60 IN A 218.30.108.65
hydra.sina.com.cn. 60 IN A 218.30.108.66
hydra.sina.com.cn. 60 IN A 218.30.108.67
hydra.sina.com.cn. 60 IN A 218.30.108.68
hydra.sina.com.cn. 60 IN A 218.30.108.69
hydra.sina.com.cn. 60 IN A 218.30.108.72
hydra.sina.com.cn. 60 IN A 218.30.108.73
hydra.sina.com.cn. 60 IN A 218.30.108.74
hydra.sina.com.cn. 60 IN A 218.30.108.55
hydra.sina.com.cn. 60 IN A 218.30.108.56
hydra.sina.com.cn. 60 IN A 218.30.108.57
hydra.sina.com.cn. 60 IN A 218.30.108.58
sina.com.cn. 86400 IN NS ns1.sina.com.cn.
sina.com.cn. 86400 IN NS ns2.sina.com.cn.
sina.com.cn. 86400 IN NS ns3.sina.com.cn.
;; Received 434 bytes from 202.106.184.166#53(ns1.sina.com.cn) in 31 ms
从上面的记录,我们可以看到整个的流程,从根服务器查询到cn的根服务器,然后查询到sina.com.cn的名字服务器,
news.sina.com.cn -> jupiter.sina.com.cn -->hydra.sina.com.cn 最后得到hydra的服务器IP。
;; QUESTION SECTION:
;sina.com.cn. IN A
;; ANSWER SECTION:
sina.com.cn. 37 IN A 202.108.33.32
>dig sina.com.cn ns //查询NS记录
;; QUESTION SECTION:
;sina.com.cn. IN NS
;; ANSWER SECTION:
sina.com.cn. 21478 IN NS ns2.sina.com.cn.
sina.com.cn. 21478 IN NS ns3.sina.com.cn.
sina.com.cn. 21478 IN NS ns1.sina.com.cn.
>dig sina.com.cn soa //查询SOA记录
;; QUESTION SECTION:
;sina.com.cn. IN SOA
;; ANSWER SECTION:
sina.com.cn. 600 IN SOA ns1.sina.com.cn. senjin.staff.sina.com.cn. 5 1800 600 604801 600
另外,还可以
dig @Server sina.com.cn. //在Server服务器上查询sina.com.cn的记录,比如
>dig @210.51.191.22 sina.com.cn
;; QUESTION SECTION:
;sina.com.cn. IN A
;; AUTHORITY SECTION:
sina.com.cn. 21600 IN NS ns1.sina.com.cn.
sina.com.cn. 21600 IN NS ns2.sina.com.cn.
sina.com.cn. 21600 IN NS ns3.sina.com.cn.
;; ADDITIONAL SECTION:
ns1.sina.com.cn. 21600 IN A 202.106.184.166
ns2.sina.com.cn. 21600 IN A 61.172.201.254
ns3.sina.com.cn. 21600 IN A 202.108.44.55
# 查找一个域的授权 dns 服务器
dig sina.com.cn. +nssearch
SOA ns1.sina.com.cn. senjin.staff.sina.com.cn. 5 1800 600 604801 600 from server ns1.sina.com.cn in 31 ms.
SOA ns1.sina.com.cn. senjin.staff.sina.com.cn. 5 1800 600 604801 600 from server ns3.sina.com.cn in 31 ms.
SOA ns1.sina.com.cn. senjin.staff.sina.com.cn. 5 1800 600 604801 600 from server ns2.sina.com.cn in 46 ms.
# 从根服务器开始追踪一个域名的解析过程
>dig news.sina.com.cn +trace
;; global options: printcmd
. 518138 IN NS A.ROOT-SERVERS.NET.
. 518138 IN NS B.ROOT-SERVERS.NET.
. 518138 IN NS C.ROOT-SERVERS.NET.
. 518138 IN NS D.ROOT-SERVERS.NET.
. 518138 IN NS E.ROOT-SERVERS.NET.
. 518138 IN NS F.ROOT-SERVERS.NET.
. 518138 IN NS G.ROOT-SERVERS.NET.
. 518138 IN NS H.ROOT-SERVERS.NET.
. 518138 IN NS I.ROOT-SERVERS.NET.
. 518138 IN NS J.ROOT-SERVERS.NET.
. 518138 IN NS K.ROOT-SERVERS.NET.
. 518138 IN NS L.ROOT-SERVERS.NET.
. 518138 IN NS M.ROOT-SERVERS.NET.
;; Received 228 bytes from 192.168.1.1#53(192.168.1.1) in 15 ms
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.
cn. 172800 IN NS A.DNS.cn.
cn. 172800 IN NS B.DNS.cn.
;; Received 297 bytes from 198.41.0.4#53(A.ROOT-SERVERS.NET) in 281 ms
sina.com.cn. 21600 IN NS ns3.sina.com.cn.
sina.com.cn. 21600 IN NS ns1.sina.com.cn.
sina.com.cn. 21600 IN NS ns2.sina.com.cn.
;; Received 136 bytes from 203.119.29.1#53(E.DNS.cn) in 171 ms
news.sina.com.cn. 60 IN CNAME jupiter.sina.com.cn.
jupiter.sina.com.cn. 60 IN CNAME hydra.sina.com.cn.
hydra.sina.com.cn. 60 IN A 218.30.108.61
hydra.sina.com.cn. 60 IN A 218.30.108.62
hydra.sina.com.cn. 60 IN A 218.30.108.63
hydra.sina.com.cn. 60 IN A 218.30.108.64
hydra.sina.com.cn. 60 IN A 218.30.108.65
hydra.sina.com.cn. 60 IN A 218.30.108.66
hydra.sina.com.cn. 60 IN A 218.30.108.67
hydra.sina.com.cn. 60 IN A 218.30.108.68
hydra.sina.com.cn. 60 IN A 218.30.108.69
hydra.sina.com.cn. 60 IN A 218.30.108.72
hydra.sina.com.cn. 60 IN A 218.30.108.73
hydra.sina.com.cn. 60 IN A 218.30.108.74
hydra.sina.com.cn. 60 IN A 218.30.108.55
hydra.sina.com.cn. 60 IN A 218.30.108.56
hydra.sina.com.cn. 60 IN A 218.30.108.57
hydra.sina.com.cn. 60 IN A 218.30.108.58
sina.com.cn. 86400 IN NS ns1.sina.com.cn.
sina.com.cn. 86400 IN NS ns2.sina.com.cn.
sina.com.cn. 86400 IN NS ns3.sina.com.cn.
;; Received 434 bytes from 202.106.184.166#53(ns1.sina.com.cn) in 31 ms
从上面的记录,我们可以看到整个的流程,从根服务器查询到cn的根服务器,然后查询到sina.com.cn的名字服务器,
news.sina.com.cn -> jupiter.sina.com.cn -->hydra.sina.com.cn 最后得到hydra的服务器IP。