DNS反向解析即由IP地址反查域名信息。html
通常的dns反向解析能够使用dig -x参数加上IP地址便可,能够实现从IP地址反查注册域名信息。服务器
若是须要查询该域名的详细注册信息,包括所在国家、省、市、联系方式等,能够使用whois命令,dig工具包含了whois命令,能够直接使用whois 加上IP地址便可,此外,有不少提供whois查询的网站也能够实现该功能。ide
若是须要查询该IP地址所在的自治域号则是一件比较麻烦的事情,通常若是使用whois查询,结果中含有origin字段,则表示其自治域号,不过通常的貌似都没有,在求助于中文网站无果后,开始求助外文网站,果真发现一个挺好的网站http://www.team-cymru.org/Services/ip-to-asn.html#whois,提供IP和ASN的映射。
工具
例如咱们要反查IP 2216.6.4,能够利用这个网站提供的服务器origin.asn.cymru.com,使用以下命令网站
# dig 4.6.6.221.origin.asn.cymru.com TXTspa
; <<>> DiG 8.3 <<>> 4.6.6.221.origin.asn.cymru.com TXT
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUERY SECTION:
;; 4.6.6.221.origin.asn.cymru.com, type = TXT, class = INcode
;; ANSWER SECTION:
4.6.6.221.origin.asn.cymru.com. 3h59m33s IN TXT "4837 | 221.6.0.0/16 | CN | apnic | 2003-01-09"htm
;; AUTHORITY SECTION:
asn.cymru.com. 23h58m49s IN NS ns1.asn.cymru.com.
asn.cymru.com. 23h58m49s IN NS ns2.asn.cymru.com.dns
;; ADDITIONAL SECTION:
ns1.asn.cymru.com. 17h44m53s IN A 38.229.0.51
ns2.asn.cymru.com. 17h44m53s IN A 38.229.0.52ip
;; Total query time: 2 msec
;; FROM: dns1.js.chinamobile.com to SERVER: default -- 211.138.200.69
;; WHEN: Thu Nov 15 17:13:45 2012
;; MSG SIZE sent: 48 rcvd: 174
以下是四台服务器的做用
The origin.asn.cymru.com zone is used to map an IP address or prefix to a corresponding BGP Origin ASN.
The origin6.asn.cymru.com zone is used to map an IPv6 address or prefix to a corresponding BGP Origin ASN.
The peer.asn.cymru.com zone is used to map an IP address or prefix to the possible BGP peer ASNs that are one AS hop away from the BGP Origin ASN's prefix.
The asn.cymru.com zone is used to determine the AS description of a given BGP ASN.