Aas*_*Aas 3 domain-name-system dig
在进行更改时,我需要检查 master 和 slave 上记录的差异。dig 是否有一些选项可以显示哪个权威名称服务器提供了答案?
例如
dig example.com +short +identify
93.184.216.34 from server 192.168.1.1 in 1 ms.
Run Code Online (Sandbox Code Playgroud)
显示我的 IP 作为信息源而不是 NS 记录之一。
我怎样才能知道它是从哪里得到这些信息的?
编辑: 阿尔弗雷德建议的输出
# dig foo.example.com +all
; <<>> DiG 9.9.3-rl.156.01-P1-RedHat-9.9.3-3.P1.fc17 <<>> foo.example.com +all
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 1612
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;foo.example.com. IN A
;; AUTHORITY SECTION:
example.com. 2924 IN SOA sns.dns.icann.org. noc.dns.icann.org. 2015082460 7200 3600 1209600 3600
;; Query time: 1 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: St dec 02 14:36:24 CET 2015
;; MSG SIZE rcvd: 101
#
Run Code Online (Sandbox Code Playgroud)
服务器 192.168.1.1 是本地主机(我的兑现名称服务器);; 服务器:192.168.1.1#53(192.168.1.1) 我需要找出哪个权威名称服务器提供了答案。
子域 +nssearch 没有输出
# dig foo.example.com +nssearch
# dig www.google.com +nssearch
# dig en.wikipedia.org +nssearch
# dig www.fsf.org +nssearch
#
Run Code Online (Sandbox Code Playgroud)
但是当询问拥有自己区域文件的域时,+nssearch 给出了答案
# dig example.com +nssearch
SOA sns.dns.icann.org. noc.dns.icann.org. 2018050821 7200 3600 1209600 3600 from server 199.43.135.53 in 108 ms.
SOA sns.dns.icann.org. noc.dns.icann.org. 2018050821 7200 3600 1209600 3600 from server 199.43.133.53 in 160 ms.
;; no response from 2001:500:8d::53
# dig google.com +nssearch
SOA ns1.google.com. dns-admin.google.com. 203084235 900 900 1800 60 from server 216.239.32.10 in 25 ms.
SOA ns1.google.com. dns-admin.google.com. 203084235 900 900 1800 60 from server 216.239.36.10 in 25 ms.
SOA ns1.google.com. dns-admin.google.com. 203084235 900 900 1800 60 from server 216.239.38.10 in 25 ms.
SOA ns1.google.com. dns-admin.google.com. 203084235 900 900 1800 60 from server 216.239.34.10 in 37 ms.
;; no response from 2001:4860:4802:34::a
;; no response from 2001:4860:4802:32::a
;; no response from 2001:4860:4802:36::a
# dig wikipedia.com +nssearch
SOA ns0.wikimedia.org. hostmaster.wikimedia.org. 2018031919 43200 7200 1209600 3600 from server 91.198.174.239 in 23 ms.
SOA ns0.wikimedia.org. hostmaster.wikimedia.org. 2018031919 43200 7200 1209600 3600 from server 208.80.154.238 in 139 ms.
SOA ns0.wikimedia.org. hostmaster.wikimedia.org. 2018031919 43200 7200 1209600 3600 from server 208.80.153.231 in 151 ms.
# dig fsf.org +nssearch
SOA ns1.gnu.org. hostmaster.gnu.org. 2941143849 3600 300 3600000 3600 from server 46.43.37.70 in 35 ms.
SOA ns1.gnu.org. hostmaster.gnu.org. 2941143849 3600 300 3600000 3600 from server 208.118.235.164 in 110 ms.
;; no response from 2001:41c8:20:2d3::a
#
Run Code Online (Sandbox Code Playgroud)
再次感谢阿尔弗雷德。
从手册页:
描述 dig(域信息搜索器)是一种用于查询 DNS 名称服务器的灵活工具。它执行 DNS 查找并显示从被查询的名称服务器返回的答案。大多数 DNS 管理员使用 dig 来解决 DNS 问题...
dig foo.example.com +all
Run Code Online (Sandbox Code Playgroud)
发出此命令返回服务器:
;; Query time: 32 msec
;; SERVER: IP#XY(IP)
;; WHEN: Wed Dec 02 14:34:50 CET 2015
;; MSG SIZE rcvd: 39
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)+[no]nssearch When this option is set, dig attempts to find the authoritative name servers for the zone containing the name being looked up and display the SOA record that each name server has for the zone.
dig foo.example.com +nssearch
Run Code Online (Sandbox Code Playgroud)
还要检查: