有一個IP要反查,如果用nslookup就只能得到有或沒有結果,但是要如何知道這個IP授權到那一個DNS Server?
可以用dig來查詢:
#dig -x 8.8.8.8
……略……
;; ANSWER SECTION:
8.8.8.8.in-addr.arpa. 86136 IN PTR google-public-dns-a.google.com.
……略……
#dig -x 8.8.8.9
……略……
;; AUTHORITY SECTION:
8.8.8.in-addr.arpa. 60 IN SOA ns1.google.com. dns-admin.google.com. 1509089 21600 3600 1209600 10800
……略……
如果要追蹤整個IP查詢過程,可加入+trace參數:
#dig -x 8.8.8.8 +trace
(有反解記錄的)
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6 <<>> -x 8.8.8.8 +trace
;; global options: +cmd
. 429693 IN NS k.root-servers.net.
. 429693 IN NS f.root-servers.net.
. 429693 IN NS d.root-servers.net.
. 429693 IN NS i.root-servers.net.
. 429693 IN NS j.root-servers.net.
. 429693 IN NS b.root-servers.net.
. 429693 IN NS m.root-servers.net.
. 429693 IN NS h.root-servers.net.
. 429693 IN NS l.root-servers.net.
. 429693 IN NS g.root-servers.net.
. 429693 IN NS a.root-servers.net.
. 429693 IN NS e.root-servers.net.
. 429693 IN NS c.root-servers.net.
;; Received 512 bytes from 127.0.0.1#53(127.0.0.1) in 4 ms
in-addr.arpa. 172800 IN NS c.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS a.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS b.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS f.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS d.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS e.in-addr-servers.arpa.
;; Received 414 bytes from 198.41.0.4#53(198.41.0.4) in 145 ms
8.in-addr.arpa. 86400 IN NS ns1.level3.net.
8.in-addr.arpa. 86400 IN NS ns2.level3.net.
;; Received 84 bytes from 193.0.9.1#53(193.0.9.1) in 288 ms
8.8.8.in-addr.arpa. 3600 IN NS ns2.google.com.
8.8.8.in-addr.arpa. 3600 IN NS ns3.google.com.
8.8.8.in-addr.arpa. 3600 IN NS ns4.google.com.
8.8.8.in-addr.arpa. 3600 IN NS ns1.google.com.
;; Received 120 bytes from 209.244.0.2#53(209.244.0.2) in 132 ms
8.8.8.8.in-addr.arpa. 86400 IN PTR google-public-dns-a.google.com.
;; Received 82 bytes from 216.239.34.10#53(216.239.34.10) in 25 ms
#dig -x 8.8.8.9 +trace
(沒有反解記錄的)
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6 <<>> -x 8.8.8.9 +trace
;; global options: +cmd
. 429703 IN NS l.root-servers.net.
. 429703 IN NS m.root-servers.net.
. 429703 IN NS i.root-servers.net.
. 429703 IN NS f.root-servers.net.
. 429703 IN NS d.root-servers.net.
. 429703 IN NS g.root-servers.net.
. 429703 IN NS c.root-servers.net.
. 429703 IN NS j.root-servers.net.
. 429703 IN NS e.root-servers.net.
. 429703 IN NS h.root-servers.net.
. 429703 IN NS k.root-servers.net.
. 429703 IN NS a.root-servers.net.
. 429703 IN NS b.root-servers.net.
;; Received 512 bytes from 127.0.0.1#53(127.0.0.1) in 5 ms
in-addr.arpa. 172800 IN NS b.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS e.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS a.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS c.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS f.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS d.in-addr-servers.arpa.
;; Received 414 bytes from 2001:dc3::35#53(2001:dc3::35) in 169 ms
8.in-addr.arpa. 86400 IN NS ns1.level3.net.
8.in-addr.arpa. 86400 IN NS ns2.level3.net.
;; Received 84 bytes from 2001:43f8:110::10#53(2001:43f8:110::10) in 455 ms
8.8.8.in-addr.arpa. 3600 IN NS ns1.google.com.
8.8.8.in-addr.arpa. 3600 IN NS ns4.google.com.
8.8.8.in-addr.arpa. 3600 IN NS ns3.google.com.
8.8.8.in-addr.arpa. 3600 IN NS ns2.google.com.
;; Received 120 bytes from 209.244.0.2#53(209.244.0.2) in 132 ms
8.8.8.in-addr.arpa. 60 IN SOA ns1.google.com. dns-admin.google.com. 1509089 21600 3600 1209600 10800
;; Received 98 bytes from 216.239.34.10#53(216.239.34.10) in 29 ms