2ha*_*med 14 domain whois domain-registration tld
我正在寻找可用于 whois 脚本的可靠且最新的 WHOIS 服务器列表。
由于列表经常更改,如果有我可以参考的资源而不是经常更新脚本,那就太好了。
Håk*_*ist 22
有几种众所周知的方法可以定位 TLD 的 whois 服务器,IANA 数据库可能最接近问题要求的内容,但是还有其他来源可能在实践中更有用。
浏览http://www.iana.org/domains/root/db或在 whois 数据库中搜索whois.iana.orgTLD。每个条目都有一个指定whois服务器的字段。
例子:
$ whois -h whois.iana.org com
[Querying whois.iana.org]
[whois.iana.org]
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
domain: COM
organisation: VeriSign Global Registry Services
address: 12061 Bluemont Way
address: Reston Virginia 20190
address: United States
contact: administrative
name: Registry Customer Service
organisation: VeriSign Global Registry Services
address: 12061 Bluemont Way
address: Reston Virginia 20190
address: United States
phone: +1 703 925-6999
fax-no: +1 703 948 3978
e-mail: info@verisign-grs.com
contact: technical
name: Registry Customer Service
organisation: VeriSign Global Registry Services
address: 12061 Bluemont Way
address: Reston Virginia 20190
address: United States
phone: +1 703 925-6999
fax-no: +1 703 948 3978
e-mail: info@verisign-grs.com
nserver: A.GTLD-SERVERS.NET 192.5.6.30 2001:503:a83e:0:0:0:2:30
nserver: B.GTLD-SERVERS.NET 192.33.14.30 2001:503:231d:0:0:0:2:30
nserver: C.GTLD-SERVERS.NET 192.26.92.30
nserver: D.GTLD-SERVERS.NET 192.31.80.30
nserver: E.GTLD-SERVERS.NET 192.12.94.30
nserver: F.GTLD-SERVERS.NET 192.35.51.30
nserver: G.GTLD-SERVERS.NET 192.42.93.30
nserver: H.GTLD-SERVERS.NET 192.54.112.30
nserver: I.GTLD-SERVERS.NET 192.43.172.30
nserver: J.GTLD-SERVERS.NET 192.48.79.30
nserver: K.GTLD-SERVERS.NET 192.52.178.30
nserver: L.GTLD-SERVERS.NET 192.41.162.30
nserver: M.GTLD-SERVERS.NET 192.55.83.30
ds-rdata: 30909 8 2 E2D3C916F6DEEAC73294E8268FB5885044A833FC5459588F4A9184CFC41A5766
whois: whois.verisign-grs.com
status: ACTIVE
remarks: Registration information: http://www.verisign-grs.com
created: 1985-01-01
changed: 2012-02-15
source: IANA
$
Run Code Online (Sandbox Code Playgroud)
该名称tld.whois-servers.net是CNAME适当的 whois 服务器的名称。有点不清楚谁实际维护它,但它似乎很受欢迎,因为它很容易与几乎所有 whois 客户端一起使用(并且一些客户端默认使用此服务)。
例子:
$ dig com.whois-servers.net +noall +answer
; <<>> DiG 9.9.4-P2-RedHat-9.9.4-15.P2.fc20 <<>> com.whois-servers.net +noall +answer
;; global options: +cmd
com.whois-servers.net. 600 IN CNAME whois.verisign-grs.com.
whois.verisign-grs.com. 5 IN A 199.7.55.74
$
Run Code Online (Sandbox Code Playgroud)
许多注册管理机构直接在相关区域的 DNS 中发布他们的 whois 服务器的地址作为_nicname._tcp SRV记录。
例子:
$ dig _nicname._tcp.us SRV +noall +answer
; <<>> DiG 9.9.4-P2-RedHat-9.9.4-15.P2.fc20 <<>> _nicname._tcp.us SRV +noall +answer
;; global options: +cmd
_nicname._tcp.us. 518344 IN SRV 0 0 43 whois.nic.us.
$
Run Code Online (Sandbox Code Playgroud)
我定期将来自IANA和PSL的列表编译成一个 XML 文件,包括 whois 服务器、注册商、二级域,如果可能的话,还有可用性的正则表达式:https : //github.com/whois-server-list/whois-server-list
我最近一直在玩 WHOIS,我发现一些公开可用的 whois 包 [即 CentOS 的 jwhois] 似乎依赖于预先打包的 TLD WHOIS 服务器列表。虽然这对大多数 TLD 来说没有问题,但对于像.horse.
100% 可靠的方法是在 IANA 的 WHOIS 服务器上查找 TLD whois.iana.org,解析whois:条目,然后在该服务器上查询域信息。例如:
foo@bar:~ $ echo -e "horse\r\n" | nc -i 1 whois.iana.org 43
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
domain: HORSE
[snip]
whois: whois-dub.mm-registry.com
[snip]
Connection closed by foreign host.
Run Code Online (Sandbox Code Playgroud)
进而:
foo@bar:~ $ echo -e "dord.horse\r\n" | nc -i 1 whois-dub.mm-registry.com 43
Domain Name: dord.horse
Domain ID: 1742946-MMd1
WHOIS Server: whois-dub.mm-registry.com
[snip]
Run Code Online (Sandbox Code Playgroud)
如果您使用这种方法,您应该礼貌地将来自 IANA 服务器的响应缓存至少 48 小时,如果不是更长的话,因为它们很少发生变化,而且 IANA 的服务器往往承受着巨大的负载。