【美高梅棋牌官网】首先向whois.apin.net查询某个

这里使用php通过查询whois信息的网站列表进行查询

目前负责 IPV4的大区 whois.arin.net 美洲区 北美 whois.apnic.net 亚太区 包括亚洲和澳大利亚 whois.ripe.net 欧洲区 欧洲/中东(西亚)/北非 whois.lacnic.net 拉美区 拉丁美洲和加勒比海区域 非洲网络的IP查询也在whois.arin.net 向某个whois服务器提交whois查询的过程

本文实例讲述了php查询whois信息的方法。分享给大家供大家参考。具体如下:

用PHP实现 1.验证IP(用 ip2long代替 ereg) 2.向 whois.arin.net查询,如果数据库中没有相关信息,会给出一个Referral Server的URL,格式如下 ReferralServer: 然后根据此信息,继续查询

希望本文所述对大家的php程序设计有所帮助。

由于Internet的历史原因,apin负责整个网络IP的整体规划以及北美区 还有部分非洲地区的IP分配管理,与此相应的是,whois.apin.net是IP whois的root server,标准的IP whois查询方法是,首先向whois.apin.net查询某个IP属于哪个大区,然后再向该区的whois 服务器查询此IP的whois详细信息。

function whois_query { // fix the domain name: $domain = strtolower; $domain = preg_replace('/^http:///i', '', $domain); $domain = preg_replace('/^www./i', '', $domain); $domain = explode; $domain = trim; // split the TLD from domain name $_domain = explode; $lst = count-1; $ext = $_domain[$lst]; // You find resources and lists // like these on wikipedia: // // http://de.wikipedia.org/wiki/Whois // $servers = array( "biz" => "whois.neulevel.biz", "com" => "whois.internic.net", "us" => "whois.nic.us", "coop" => "whois.nic.coop", "info" => "whois.nic.info", "name" => "whois.nic.name", "net" => "whois.internic.net", "gov" => "whois.nic.gov", "edu" => "whois.internic.net", "mil" => "rs.internic.net", "int" => "whois.iana.org", "ac" => "whois.nic.ac", "ae" => "whois.uaenic.ae", "at" => "whois.ripe.net", "au" => "whois.aunic.net", "be" => "whois.dns.be", "bg" => "whois.ripe.net", "br" => "whois.registro.br", "bz" => "whois.belizenic.bz", "ca" => "whois.cira.ca", "cc" => "whois.nic.cc", "ch" => "whois.nic.ch", "cl" => "whois.nic.cl", "cn" => "whois.cnnic.net.cn", "cz" => "whois.nic.cz", "de" => "whois.nic.de", "fr" => "whois.nic.fr", "hu" => "whois.nic.hu", "ie" => "whois.domainregistry.ie", "il" => "whois.isoc.org.il", "in" => "whois.ncst.ernet.in", "ir" => "whois.nic.ir", "mc" => "whois.ripe.net", "to" => "whois.tonic.to", "tv" => "whois.tv", "ru" => "whois.ripn.net", "org" => "whois.pir.org", "aero" => "whois.information.aero", "nl" => "whois.domain-registry.nl" ); if (!isset{ die('Error: No matching nic server found!'); } $nic_server = $servers[$ext]; $output = ''; // connect to whois server: if ($conn = fsockopen  { fputs($conn, $domain."rn"); while { $output .= fgets; } fclose; } else { die('Error: Could not connect to ' . $nic_server . '!'); } return $output;}// Some example queries:print whois_query;print whois_query;print whois_query;

?

打开一个到whois服务器的43端口的连接,然后发送要查询的域名 和一个回车换行。如果要查询多个域名,请用空格分开然后从sokect中读取结果。最后服务器将自动断开连接。

5.whois.abuse.net

4.Go Daddy (whois.godaddy.com)

2.BulkRegister (whois.bulkregiter.net) 小心它临时封IP,如果大量连接的话

?php include_once "lang.inc.php";

function ReadSocket($whois,$ip) { global $Text; $buffer = ''; if (!$sock = fsockopen( $whois, 43, $errNum, $errStr, 20)) { $buffer = str_replace('%SERVER%', $whois, $Text['sock_fail']); } else { fputs($sock,"$ip/n"); //$buffer = fread($sock, 8192); while(!feof($sock)) $buffer.=fgets($sock, 8192); fclose($sock); } return $buffer; }

whoisip.php

本文由美高梅游戏网站登录发布于美高梅棋牌游戏,转载请注明出处:【美高梅棋牌官网】首先向whois.apin.net查询某个

您可能还会对下面的文章感兴趣: