whois 查询

global_boy 2005-05-19 04:44:31
贡献一个我写的WHOIS系统给大家,希望诸位能够将其改进一下再贴出来。)


=====================================================================


<?php

header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Expires: now");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");


$domain=$_REQUEST['domain'];
$server=$_REQUEST['server'];
$domain3="T";


function bar2($domainb){
if($domainb==""){
return "C1";
}
$domain2=substr($domainb,-3);
switch($domain2){
case "com":
$server="whois.internic.net";
break;
case "net":
$server="whois.internic.net";
break;
case "org":
$server="whois.pir.org";
break;
case "nfo":
$server="whois.afilias.info";
break;
case "biz":
$server="whois.biz";
break;
case ".cc":
$server="whois.nic.cc";
break;
case "edu":
$server="whois.educause.net";
break;
case "mil":
$server="whois.nic.mil";
break;
case "gov":
$server="whois.nic.gov";
break;
case ".uk":
$server="whois.nic.uk";
break;
case ".us":
$server="whois.nic.us";
break;
case "ame":
$server="whois.nic.name";
break;
case "eum":
$server="whois.museum";
break;
case ".su":
$server="whois.ripn.net";
break;
case ".ru":
$server="whois.nic.ru";
break;
case "int":
$server="whois.iana.org";
break;
case ".ws":
$server="whois.worldsite.ws";
break;
case ".kr":
$server="whois.krnic.net";
break;
case ".jp":
$server="whois.nic.ad.jp";
break;
case ".it":
$server="whois.nic.it";
break;
case ".de":
$server="whois.denic.de";
break;
case ".fr":
$server="whois.nic.fr";
break;
case ".ca":
$server="whois.cira.ca";
break;
case ".cn":
$server="whois.cnnic.net.cn";
break;
case ".tw":
$server="whois.twnic.net.tw";
break;
case ".hk":
$server="whois.hkdnr.net.hk";
break;
case ".au":
$server="whois.aunic.net";
break;
case ".ac":
$server="whois.nic.ac";
break;
default:
$server="NA&".$domainb."&".$domain2;
}
return $server;
}



if($server==""){
$server=bar2("$domain");
if(strstr($server,"NA")){
$domain3="F";
}
}


print($server."\r\n\r\n<br/><br/>");
if($domain3=="T"){
$fp = fsockopen($server, 43, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "$domain\r\n";
$out .= "Connection: Close\r\n\r\n";
fputs($fp, $out);
while (!feof($fp)) {
echo nl2br(fgets($fp, 128));
}
fclose($fp);
}
}

print("\r\n\r\n<br/><br/>");
print(date("D M j G:i:s T Y").".\r\n<br/>");
print("0-soft.com whois query system.\r\n<br/>");
print("Jason Lee, mcse86@hotmail.co.uk\r\n\r\n<br/><br/>");
print("for more info, see rfc2958.\r\n\r\n<br/><br/>");
//print("========================================\r\n\r\n<br/><br/>");

?>
...全文
226 点赞 收藏 7
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
iasky 2005-05-22
mark
回复
ddboy 2005-05-22
谢谢楼主,这是我很想知道的东西呢
回复
global_boy 2005-05-22
jxyuhua(一塌糊涂),说句不好听的你别介意。是你看错了吧?你懂英文吗?


以下是163.com的whois信息:
===================================================================
whois.internic.net


Whois Server Version 1.3

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

Domain Name: 163.COM
Registrar: NETWORK SOLUTIONS, LLC.
Whois Server: whois.networksolutions.com
Referral URL: http://www.networksolutions.com
Name Server: NS.NEASE.NET
Name Server: NS2.NEASE.NET
Status: REGISTRAR-LOCK
Updated Date: 31-mar-2005
Creation Date: 15-sep-1997
Expiration Date: 14-sep-2009


>>> Last update of whois database: Sat, 21 May 2005 10:38:24 EDT <<<
==========================================================
whois.networksolutions.com

Registrant:
Netease.com, Inc.
36/F Peace World Plaza, No.362-366
Huan Shi Dong Road
Guangzhou, Guangdong 510060
CN

Domain Name: 163.COM

Administrative Contact, Technical Contact:
Netease.com, Inc. nsadmin@corp.netease.com
36/F Peace World Plaza, No.362-366
Huan Shi Dong Road
Guangzhou, Guangdong 510060
CN
+86-20-85525516 fax: +86-20-85525535

Record expires on 24-Jan-2009.
Record created on 15-Sep-1997.
Database last updated on 22-May-2005 02:32:41 EDT.

Domain servers in listed order:

NS.NEASE.NET 202.106.185.75
NS2.NEASE.NET 202.108.42.3
回复
fzjw 2005-05-21
make
回复
gu1dai 2005-05-21
顶了再说
我也想写一个
现在看来不用了
回复
jxyuhua 2005-05-21
不好用,查了半天竟然出错了
163.com
回复
jxyuhua 2005-05-21
test
回复
发帖
基础编程
创建于2007-09-28

2.1w+

社区成员

从PHP安装配置,PHP入门,PHP基础到PHP应用
申请成为版主
帖子事件
创建了帖子
2005-05-19 04:44
社区公告
暂无公告