首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Delphi idWhois错误数据

Delphi idWhois错误数据
EN

Stack Overflow用户
提问于 2015-02-19 22:24:41
回答 2查看 639关注 0票数 0

在使用idWhois组件处理.com域时,我得到了错误的信息。以下是通过stackoverflow.com的idWhois接收的数据的示例

代码语言:javascript
复制
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.

以下是使用PHP脚本的SAIM域的结果:

代码语言:javascript
复制
*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

对于这两个请求,我都使用了服务器whis.verisign-grs.com。我尝试将"=“放在域的前面,但这没有帮助。下面是Delphi代码

代码语言:javascript
复制
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代码

代码语言:javascript
复制
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;
}

谢谢

EN

回答 2

Stack Overflow用户

发布于 2015-02-20 00:35:22

WHOIS域现在支持许多具有自己的WHOIS域的注册商,如输出中所述:

.com和.net域名中的

域名现在可以向许多不同的竞争注册商注册。有关详细信息,请访问internic.net。

您可以在初始响应中查询WHOIS服务器:

代码语言:javascript
复制
Whois Server: whois.name.com

因此,您将需要执行两次WHOIS查找,一次是针对包含.COM域初始记录的Verisign,另一次是针对注册商WHOIS。

票数 2
EN

Stack Overflow用户

发布于 2015-02-20 00:36:56

问题不在TIdWhois,而是在做与PHP脚本完全相同的事情:

代码语言:javascript
复制
function TIdWHOIS.WhoIs(const ADomain: string): string;
begin
  Connect; try
    IOHandler.WriteLn(ADomain);
    Result := IOHandler.AllData;
  finally Disconnect; end;
end;

TIdWhois只是按原样返回服务器发送的任何内容。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28608819

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档