你確定ipv6地址有任何與之相關的反向DNS嗎? 報告它沒有:
$ dig -x 2404:6800:8004::68
; <<>> DiG 9.4.3-P5 <<>> -x 2404:6800:8004::68
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 35573
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;8.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.0.0.8.0.0.8.6.4.0.4.2.ip6.arpa. IN PTR
;; Query time: 364 msec
;; SERVER: 12.165.58.2#53(12.165.58.2)
;; WHEN: Thu Sep 2 03:45:50 2010
;; MSG SIZE rcvd: 90
編輯:終於發現了反向DNS相關的IPv6地址。總之,works4me。
>>> import socket
>>> socket.has_ipv6
True
>>> socket.getfqdn('2001:838:2:1::30:67')
'gatey.sixxs.net'
而且從DIG:
$ dig -x 2001:838:2:1::30:67
; <<>> DiG 9.4.3-P5 <<>> -x 2001:838:2:1::30:67
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 934
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 1
;; QUESTION SECTION:
;7.6.0.0.0.3.0.0.0.0.0.0.0.0.0.0.1.0.0.0.2.0.0.0.8.3.8.0.1.0.0.2.ip6.arpa. IN PTR
;; ANSWER SECTION:
7.6.0.0.0.3.0.0.0.0.0.0.0.0.0.0.1.0.0.0.2.0.0.0.8.3.8.0.1.0.0.2.ip6.arpa. 43200 IN PTR gatey.sixxs.net.
;; AUTHORITY SECTION:
. 517204 IN NS e.root-servers.net.
. 517204 IN NS m.root-servers.net.
. 517204 IN NS a.root-servers.net.
. 517204 IN NS l.root-servers.net.
. 517204 IN NS c.root-servers.net.
. 517204 IN NS h.root-servers.net.
. 517204 IN NS j.root-servers.net.
. 517204 IN NS g.root-servers.net.
. 517204 IN NS f.root-servers.net.
. 517204 IN NS i.root-servers.net.
. 517204 IN NS d.root-servers.net.
. 517204 IN NS b.root-servers.net.
. 517204 IN NS k.root-servers.net.
;; ADDITIONAL SECTION:
a.root-servers.net. 604222 IN A 198.41.0.4
;; Query time: 383 msec
;; SERVER: 12.165.58.2#53(12.165.58.2)
;; WHEN: Thu Sep 2 03:55:03 2010
;; MSG SIZE rcvd: 343
奇數。我用第三方工具查找了地址,並找到了主機名。我想也許它是在幕後解析whois數據或其他東西。 我無法關閉它作爲無效,所以我想它必須保持開放。 – 2010-09-02 21:39:57