Lxn-Chan!

(~ ̄▽ ̄)→))* ̄▽ ̄*)o

通过多种方式查询域名解析信息。

Ping

Ping 命令其实是最简单的查询解析的方式,通过 Ping 命令可以得知域名最终被解析到哪。

重要参数如下:

1
ping [-t] [-a] [-n count] [-i TTL] [-w timeout] [-4] [-6] target_name

DiG

dig 命令主要用来从 DNS 域名服务器查询主机地址信息。

直接查询

dig+域名

1
dig 10010.com

输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
; <<>> DiG 9.16.1-Ubuntu <<>> 10010.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46667
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;10010.com. IN A

;; ANSWER SECTION:
10010.com. 60 IN A 123.125.96.156

;; Query time: 44 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: 六 4月 30 10:56:34 CST 2022
;; MSG SIZE rcvd: 54

这里面被分成了4段,第一部分 ln 1 - ln 5 主要描述了程序的执行状况,包括程序版本和查询结果,其中status如果为NOERROR则为查询成功;

第二部分 ln 7 - ln 10 描述了查询的请求;

第三部分 ln 12 - ln 13 描述了查询结果;

第四部分 ln 15 - ln 18 描述了本次查询的统计信息和基本信息。

指定解析类型

dig+域名+类型

常见的解析类型:

类型解析
A指定该主机名的IPv4地址
AAAA指定该主机名的IPv6地址
CNAME将域名指向另一个域名地址,与其保持相同解析
MX用于邮件服务器,相关参数一般由邮件注册商提供
NS域名服务器记录
TXT可填写附加文本信息,常用于域名验证或反垃圾邮件
SPF用于指定发送邮件的服务器,是一种高效的反垃圾邮件解决方案
1
dig www.10010.com AAAA

输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
; <<>> DiG 9.16.1-Ubuntu <<>> www.10010.com AAAA
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43559
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;www.10010.com. IN AAAA

;; ANSWER SECTION:
www.10010.com. 35 IN CNAME www.10010.com.w.cdngslb.com.
www.10010.com.w.cdngslb.com. 59 IN AAAA 240e:f7:4f01:9:3::3f6
www.10010.com.w.cdngslb.com. 59 IN AAAA 240e:f7:4f01:9:3::3f5

;; Query time: 72 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: 六 4月 30 11:13:10 CST 2022
;; MSG SIZE rcvd: 136

指定 DNS 服务器

dig @DNS服务器 域名

1
dig @119.29.29.29 www.10010.com

输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 省略部分内容
; <<>> DiG 9.16.1-Ubuntu <<>> @119.29.29.29 www.10010.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6806
;; flags: qr rd ra; QUERY: 1, ANSWER: 17, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 4b4296e1099cd8d4 (echoed)
;; QUESTION SECTION:
;www.10010.com. IN A

;; ANSWER SECTION:
www.10010.com. 60 IN CNAME www.10010.com.w.cdngslb.com.
www.10010.com.w.cdngslb.com. 60 IN A 120.221.155.226
www.10010.com.w.cdngslb.com. 60 IN A 111.32.130.94

;; Query time: 100 msec
;; SERVER: 119.29.29.29#53(119.29.29.29)
;; WHEN: 六 4月 30 11:15:29 CST 2022
;; MSG SIZE rcvd: 348

提示:如果不指定的话则使用系统默认DNS。

跟踪整个查询过程

dig +trace 域名

1
dig +trace www.10010.com

输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
; <<>> DiG 9.16.1-Ubuntu <<>> +trace www.10010.com
;; global options: +cmd
. 449375 IN NS a.root-servers.net.
. 449375 IN NS b.root-servers.net.
. 449375 IN NS c.root-servers.net.
. 449375 IN NS d.root-servers.net.
. 449375 IN NS e.root-servers.net.
. 449375 IN NS f.root-servers.net.
. 449375 IN NS g.root-servers.net.
. 449375 IN NS h.root-servers.net.
. 449375 IN NS i.root-servers.net.
. 449375 IN NS j.root-servers.net.
. 449375 IN NS k.root-servers.net.
. 449375 IN NS l.root-servers.net.
. 449375 IN NS m.root-servers.net.
;; Received 262 bytes from 127.0.0.53#53(127.0.0.53) in 44 ms

com. 172800 IN NS a.gtld-servers.net.
com. 172800 IN NS g.gtld-servers.net.
com. 172800 IN NS f.gtld-servers.net.
com. 172800 IN NS m.gtld-servers.net.
com. 172800 IN NS d.gtld-servers.net.
com. 172800 IN NS k.gtld-servers.net.
com. 172800 IN NS b.gtld-servers.net.
com. 172800 IN NS e.gtld-servers.net.
com. 172800 IN NS h.gtld-servers.net.
com. 172800 IN NS c.gtld-servers.net.
com. 172800 IN NS i.gtld-servers.net.
com. 172800 IN NS j.gtld-servers.net.
com. 172800 IN NS l.gtld-servers.net.
com. 86400 IN DS 30909 8 2 E2D3C916F6DEEAC73294E8268FB5885044A833FC5459588F4A9184CF C41A5766
com. 86400 IN RRSIG DS 8 1 86400 20220512170000 20220429160000 47671 . jRaPpiLi+/o96jFyek+ll9IZLhunPdN8ep8W/Vgp9rMBpEXboSSUrGsI MYbkv5GvBY3e5phIY5npv1bPTXPypxmZJrgcOATEfoc9IlhWE4yeY8C2 hpKgyeHXiOe1F1QHUjweb/AWnD4UsappQ/5SlINCkcbg2mEmVK737DIe KG3iN/XazKYWjPZ1U8mMhXducqx/Lj6+aeDhq2c8sTzwUshgtJg2ocKP Gpk+wE1s7Vdku8brz1TSYkaOdY3sYrEHNp5JDHe9DkhFamtFv82V6y3I MevlliVLP8b1CxW/5JmSeQDWHoYGLBfoIldqCCTvZngON1tLiIRQ52qq elZtYA==
;; Received 1176 bytes from 193.0.14.129#53(k.root-servers.net) in 364 ms

10010.com. 172800 IN NS ns.bta.net.cn.
10010.com. 172800 IN NS ns2.bta.net.cn.
CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN NSEC3 1 1 0 - CK0Q1GIN43N1ARRC9OSM6QPQR81H5M9A NS SOA RRSIG DNSKEY NSEC3PARAM
CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN RRSIG NSEC3 8 2 86400 20220503042354 20220426031354 37269 com. vPwsL+I4ptKlrtrsZXrs/Z3/1Ebd3eBCm5f73FcuoljLz9RHDPdxfGCd rHmK3oWXZIErmCLYy6NgcpiMEM+JiqTQm/mNFhVfoFTGicCB9JwGgA3p XfgAB6w/hsNvtqTVuFsszhq4+CjXf1+ky0hFzTHACJ3bPmEeMa80ASwX EHu+vpL9LdLSZrtS68G2ieGvjrwcn6EZfmfJIly3i8UU9g==
91J7DP3IM0DAFROQQ4AJROFLQSU51LAJ.com. 86400 IN NSEC3 1 1 0 - 91J7M9SL4CPTUQC9HNBKREG87KDV2CEI NS DS RRSIG
91J7DP3IM0DAFROQQ4AJROFLQSU51LAJ.com. 86400 IN RRSIG NSEC3 8 2 86400 20220504054232 20220427043232 37269 com. fL06wbkc3v4DDk3OFECsbfKvZArvL8g5qLaVeRXJwRNN3hQm6j/6aPQJ In3bzqnNgYIBVrlr1KsWfjWVtdXURIaWu3necZaFYJf+YD/Mkk35lLSS qikKMfl0B4Gc/qgtVPbNHnI/BoPwqm/e7eM5eHe//NYJZs3aIOVrRn8J f7ANDgbpTtOSt1gLUBwKepy4JaLktKmRBXjPQ3EvRPzwBg==
;; Received 636 bytes from 2001:503:d2d::30#53(k.gtld-servers.net) in 100 ms

www.10010.com. 60 IN CNAME www.10010.com.w.cdngslb.com.
;; Received 80 bytes from 2408:8000:1010:1::10#53(ns2.bta.net.cn) in 20 ms

综合一下

1
dig +trace @2001:503:c27::2:30 bfdmirrors6.a.s.tuna.tsinghua.edu.cn AAAA

输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
; <<>> DiG 9.16.1-Ubuntu <<>> +trace @2001:503:c27::2:30 bfdmirrors6.a.s.tuna.tsinghua.edu.cn AAAA
; (1 server found)
;; global options: +cmd
. 518400 IN NS e.root-servers.net.
. 518400 IN NS h.root-servers.net.
. 518400 IN NS l.root-servers.net.
. 518400 IN NS i.root-servers.net.
. 518400 IN NS a.root-servers.net.
. 518400 IN NS d.root-servers.net.
. 518400 IN NS c.root-servers.net.
. 518400 IN NS b.root-servers.net.
. 518400 IN NS j.root-servers.net.
. 518400 IN NS k.root-servers.net.
. 518400 IN NS g.root-servers.net.
. 518400 IN NS m.root-servers.net.
. 518400 IN NS f.root-servers.net.
. 518400 IN RRSIG NS 8 0 518400 20220512170000 20220429160000 47671 . HsZUuqySH4T0xivdCRLh9IA6U2P/F6gVbWxFALPs3DEyAo9N/vSSezAF 8hC9fhLiqGUbZN0SLIJ7o6zslVm8+0bkwqS5wAUL+VIpCEEVTW13I3Uk UJSsgpmuUGIbYhiJUWqRbM/DYrd3FwXGFBffKUD0GivBJ6nwamSUa0Hq jnxHMYipb9scDjt2N67AQjoOil87UmdrCom3zdjrVNkjj2et71NLMeXY LM+HWitKRUdNhi4LWU1/gxfa94M9dqDOaSD4QyC4hJ1BdRsQwUbWVX3Z Bvr5QhtubpYSnZePZ2zBrmwp2hTEps3l5GSYJF96KpDJ6xgMehd3fh1t eESTxQ==
;; Received 1097 bytes from 2001:503:c27::2:30#53(2001:503:c27::2:30) in 324 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 f.dns.cn.
cn. 172800 IN NS g.dns.cn.
cn. 172800 IN NS ns.cernet.net.
cn. 86400 IN DS 57724 8 2 5D0423633EB24A499BE78AA22D1C0C9BA36218FF49FD95A4CDF1A4AD 97C67044
cn. 86400 IN RRSIG DS 8 1 86400 20220512170000 20220429160000 47671 . IW2jOIUGE8XFocpa32Uk83SxmKULKcAhq5sjVY5PQGa7G1I+GFnrwaJg JJB7OXAmpojS8Fjcp1IkbST3DYStWKnZ+4aVvexmxBrbtHkCYCzVY+k+ NucYzbHKAYFbjl8ijQcOrd2szjVgfUX2pcKZ+9mShKb/fCMnjhM7yE57 Hgu7/i3IXlu5yR5717YBEfAIlLbqang/VHTtoQ3eatWdMAknquUosUY+ 6GW8yRzUn2MORADDrMJgrkWPvi/B/I2Ao93x+Rv6bXD0eEYL5J9mwhtE oRoZxXjSGevaQ27ch7VFduZmsGGIP6tlSqS4NuD2d4BKDPPRP0ar23dh kMymFQ==
;; Received 727 bytes from 2001:500:9f::42#53(l.root-servers.net) in 24 ms

edu.cn. 172800 IN NS dns.edu.cn.
edu.cn. 172800 IN NS ns2.cuhk.hk.
edu.cn. 172800 IN NS ns2.cernet.net.
edu.cn. 172800 IN NS dns2.edu.cn.
edu.cn. 172800 IN NS deneb.dfn.de.
edu.cn. 86400 IN DS 15397 8 1 CA602972D554DF57CC8322C18D9CF942FAC47430
edu.cn. 86400 IN DS 15397 8 2 3A6C89D32B3143D193521CE64389548821DA90F770AB09ECD9C8680B 2F4848B5
edu.cn. 86400 IN RRSIG DS 8 2 86400 20220513135414 20220413130440 38388 cn. T6YzJUJlMEI+cOvnpEgoSuRngnBjReFOfqQ4ek7aeQkJt9LAlJJK62dV xIpwytKGVQHleGWgtREjLcvJZJTTT4zVFCGF+6rYmY7nF30SH+wtqmA0 ymE3Hrd+VZl/EhsUibEFl5MxPldgpzmU94M7J4yxfEtueEiliTN0aZkp 5xw=
;; Received 527 bytes from 2001:dc7:1000::1#53(d.dns.cn) in 4 ms

tuna.tsinghua.edu.cn. 21600 IN NS dns3.tuna.tsinghua.edu.cn.
tuna.tsinghua.edu.cn. 21600 IN NS dns2.tuna.tsinghua.edu.cn.
tuna.tsinghua.edu.cn. 21600 IN NS dns1.tuna.tsinghua.edu.cn.
;; Received 254 bytes from 202.112.0.13#53(dns2.edu.cn) in 48 ms

bfdmirrors6.a.s.tuna.tsinghua.edu.cn. 300 IN AAAA 2402:f000:1:400::2
s.tuna.tsinghua.edu.cn. 86400 IN NS dns1.tuna.tsinghua.edu.cn.
s.tuna.tsinghua.edu.cn. 86400 IN NS dns2.tuna.tsinghua.edu.cn.
s.tuna.tsinghua.edu.cn. 86400 IN NS dns3.tuna.tsinghua.edu.cn.
;; Received 200 bytes from 2402:f000:1:416:101:6:6:172#53(dns1.tuna.tsinghua.edu.cn) in 64 ms

Nslookup

nslookup 命令用于查询 DNS 的记录,查看域名解析是否正常,在网络故障的时候用来诊断网络问题。

nslookup domain [dns-server]

1
nslookup www.10010.com 114.114.114.114

输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Server:         114.114.114.114
Address: 114.114.114.114#53

Non-authoritative answer:
www.10010.com canonical name = www.10010.com.w.cdngslb.com.
Name: www.10010.com.w.cdngslb.com
Address: 111.32.130.119
Name: www.10010.com.w.cdngslb.com
Address: 111.32.130.93
Name: www.10010.com.w.cdngslb.com
Address: 120.221.156.103
Name: www.10010.com.w.cdngslb.com
Address: 2409:8c3c:1300:5:3::3fd
Name: www.10010.com.w.cdngslb.com
Address: 2409:8c3c:1300:5:3::3fe

 简单说两句



联系站长 | 安装证书 | 友情链接

备案号:辽ICP备19013963号

萌ICP备 20219421 号

中国互联网违法和不良信息举报中心

架构版本号:8.0.10 | 本站已全面支持IPv6

本站由又拍云提供CDN加速服务和存储服务

正在载入运行数据(1/2)请稍后...
正在载入运行数据(2/2)请稍后...

Copyright 2022 LingXuanNing, All rights reserved.