我正在尝试使用 WhoisClient 对象进行 WHOIS 查询,但效果不佳。我的代码非常简单:
String WHOIS_SERVER = WhoisClient.DEFAULT_HOST;
int WHOIS_PORT = 43;
String hostName = "www.google.com";
WhoisClient whoisClient = new WhoisClient();
try
{
whoisClient.connect(WHOIS_SERVER, WHOIS_PORT);
String results = whoisClient.query(hostName);
return results;
}
catch(IOException e)
{
....
}
所以有些事情是错误的。我获取了注册商信息,但没有获取所有者信息。此外,还有大量有关其他 TLD 中的 Google 域的信息,而不仅仅是 google.com。
我很确定我没有正确指定主机来获得我想要的东西。文档说:
程序员需要熟悉 whois 服务器的句柄语法。
不确定那是什么意思。我怎样才能做得更好?
不完全确定您到底想要返回什么,但从某些 Web 客户端运行 whois 查询返回的数据略有不同。维基百科页面 http://en.wikipedia.org/wiki/Whois有一些信息。
因此,我更改了以下行,并从使用默认主机名中得到了一些不同的结果。
whoisClient.connect("whois.iana.org", WHOIS_PORT); // changed host name
Results:
% IANA WHOIS 服务器
% 有关 IANA 的更多信息,请访问http://www.iana.org http://www.iana.org% 该查询返回 1 个对象
refer: whois.verisign-grs.com
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: [email protected] /cdn-cgi/l/email-protection
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: [email protected] /cdn-cgi/l/email-protection
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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)