【发布时间】:2015-02-19 14:24:40
【问题描述】:
使用 idWhois 组件处理 .com 域时,我收到错误信息。这是通过 idWhois 为 stackoverflow.com 接收的数据示例
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to internic.net
for detailed information.
Domain Name: STACKOVERFLOW.COM
Registrar: NAME.COM, INC.
Sponsoring Registrar IANA ID: 625
Whois Server: whois.name.com
Referral URL: name.com
Name Server: CF-DNS01.STACKOVERFLOW.COM
Name Server: CF-DNS02.STACKOVERFLOW.COM
Status: clientTransferProhibited
Updated Date: 09-may-2014
Creation Date: 26-dec-2003
Expiration Date: 26-dec-2015
>>> Last update of whois database: Thu, 19 Feb 2015 14:02:05 GMT <<<
NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar. Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.
TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability. VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.
The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.
以下是 saim 域但使用 PHP 脚本的结果:
*Domain Name: STACKOVERFLOW.COM
Registry Domain ID: 108907621_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.name.com
Registrar URL: name.com
Updated Date: 2014-05-09T17:51:17-06:00Z
Creation Date: 2003-12-26T19:18:07-07:00Z
Registrar Registration Expiration Date: 2015-12-26T19:18:07-07:00Z
Registrar: Name.com, Inc.
Registrar IANA ID: 625
Registrar Abuse Contact Email: abuse@name.com
Registrar Abuse Contact Phone: +1.17203101849
Reseller:
Domain Status: clientTransferProhibited
Registry Registrant ID:
Registrant Name: Sysadmin Team
Registrant Organization: Stack Exchange, Inc.
Registrant Street: 1 Exchange Plaza , Floor 26
Registrant City: New York
Registrant State/Province: NY
Registrant Postal Code: 10006
Registrant Country: US
Registrant Phone: +1.2122328280
Registrant Email: sysadmin-team@stackoverflow.com
Registry Admin ID:
Admin Name: Sysadmin Team
Admin Organization: Stack Exchange, Inc.
Admin Street: 1 Exchange Plaza , Floor 26
Admin City: New York
Admin State/Province: NY
Admin Postal Code: 10006
Admin Country: US
Admin Phone: +1.2122328280
Admin Email: sysadmin-team@stackoverflow.com
Registry Tech ID:
Tech Name: Sysadmin Team
Tech Organization: Stack Exchange, Inc.
Tech Street: 1 Exchange Plaza , Floor 26
Tech City: New York
Tech State/Province: NY
Tech Postal Code: 10006
Tech Country: US
Tech Phone: +1.2122328280
Tech Email: sysadmin-team@stackoverflow.com
Name Server: cf-dns02.stackoverflow.com
Name Server: cf-dns01.stackoverflow.com
对于这两个请求,我都使用服务器 whois.verisign-grs.com。我试图在域之前放置“=”,但这没有帮助。这是Delphi代码
W := TIdWhois.Create(nil);
W.ReadTimeout := 10000;
W.ConnectTimeout := 10000;
try
W.Host := 'whois.verisign-grs.com';
if Zone = 'com' then
Result := W.WhoIs('=' + Domain)
else
Result := W.WhoIs(Domain);
except end;
W.Free;
这是 PHP 代码
function QueryWhoisServer($whoisserver, $domain) {
$port = 43;
$timeout = 15;
$fp = @fsockopen($whoisserver, $port, $errno, $errstr, $timeout) or die("Socket Error " . $errno . " - " . $errstr);
if($whoisserver == "whois.verisign-grs.com") $domain = "=".$domain;
fputs($fp, $domain . "\r\n");
$out = "";
while(!feof($fp)){
$out .= fgets($fp);
}
fclose($fp);
$res = "";
if((strpos(strtolower($out), "error") === FALSE) && (strpos(strtolower($out), "not allocated") === FALSE)) {
$rows = explode("\n", $out);
foreach($rows as $row) {
$row = trim($row);
if(($row != '') && ($row{0} != '#') && ($row{0} != '%')) {
$res .= $row."\n";
}
}
}
return $res;
}
谢谢
【问题讨论】: