whois域名查询代码分享
来源:互联网 发布:数据分析模型作用 编辑:程序博客网 时间:2024/04/29 18:23
whois域名查询代码分享
<?php$domain = $_GET['domain'];$whoisservers = array( "aero"=>"whois.aero", "arpa" =>"whois.iana.org", "asia" =>"whois.nic.asia", "at" =>"whois.nic.at", "be" =>"whois.dns.be", "biz" =>"whois.biz", "br" =>"whois.registro.br", "ca" =>"whois.cira.ca", "cc" =>"whois.nic.cc", "cn" =>"whois.cnnic.net.cn", "com" =>"whois.verisign-grs.com", "gov" =>"whois.nic.gov", "in" =>"whois.inregistry.net", "co.in" =>"whois.inregistry.net", "net.in" =>"whois.inregistry.net", "org.in" =>"whois.inregistry.net", "ind.in" =>"whois.inregistry.net", "firm.in" =>"whois.inregistry.net", "info" =>"whois.afilias.info", "int" =>"whois.iana.org", "is" =>"whois.isnic.is", "it" =>"whois.nic.it", "jobs" =>"jobswhois.verisign-grs.com", "me" =>"whois.meregistry.net", "mil" =>"whois.nic.mil", "mobi" =>"whois.dotmobiregistry.net", "museum" =>"whois.museum", "name" =>"whois.nic.name", "net" =>"whois.verisign-grs.net", "org" =>"whois.pir.org", "pro" =>"whois.registrypro.pro", "tc" =>"whois.adamsnames.tc", "tel" =>"whois.nic.tel", "travel" =>"whois.nic.travel", "tv" => "whois.www.tv", "co.uk" =>"whois.nic.uk", "org.uk" =>"whois.nic.uk", "us" =>"whois.nic.us", "ws" =>"whois.website.ws");function LookupDomain($domain){ global $whoisservers; $whoisserver = ""; $dotpos=strpos($domain,"."); $domtld=substr($domain,$dotpos+1); $whoisserver = $whoisservers[$domtld]; if(!$whoisserver) { return "Error: No appropriate Whois server found for <b>$domain</b> domain!"; } $result = QueryWhoisServer($whoisserver, $domain); if(!$result) { return "Error: No results retrieved $domain !"; } preg_match("/Whois Server: (.*)/", $result, $matches); $secondary = $matches[1]; if($secondary) { $result = QueryWhoisServer($secondary, $domain); } return $result;}function QueryWhoisServer($whoisserver, $domain) { $port = 43; $timeout = 10; $fp = @fsockopen($whoisserver, $port, $errno, $errstr, $timeout) or die("Socket Error " . $errno . " - " . $errstr); fputs($fp, $domain . "\r\n"); $out = ""; while(!feof($fp)){ $out .= fgets($fp); } fclose($fp); return $out;}?><html><head><title>在线域名WHOIS查询(whoisabc)</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><form action="<?php $_SERVER['PHP_SELF'];?>"> <p><b><label for="domain">查询域名:</label></b> <input type="text" name="domain" id="domain" autocomplete="off" title="cnyinxingshu.com"> <input type="submit" value="我要查询"> </p></form><?phpif($domain) { if(!preg_match("/^([-a-z0-9]{2,100})\.([a-z\.]{2,8})$/i", $domain)) { die("查询域名WHOIS格式, 比如. <i>cnyinxingshu.com</i>!"); } $result = LookupDomain($domain); echo "<pre>\n" . $result . "\n</pre>\n";}?></body></html>
演示:http://www.whoisabc.cn/taobao.cn
0 0
- whois域名查询代码分享
- 域名whois查询接口代码
- C#域名whois查询
- 域名WHOIS查询
- whois域名查询
- java实现whois域名查询
- 分享C#域名查询代码!
- python3实现域名查询和whois查询
- python3实现域名查询和whois查询
- python3实现域名查询和whois查询
- WHOIS查询检索,域名信息查询工具软件
- 查询域名是否注册(WHOIS)
- 域名Whois信息查询(ASP.NET+C#)
- 利用Whois服务查询域名注册信息
- 利用WHOIS协议查询Internet域名
- 利用WHOIS协议查询Internet域名
- 使用python-whois模块查询域名信息
- PHP实现域名whois查询的代码(数据源万网、新网)
- oracle用户权限视图小结
- java 多维数组
- xna 摄像机的旋转!
- 设计模式C++实现一 工厂模式
- 遇到问题要冷静
- whois域名查询代码分享
- 视网膜眼底图像的一种检测方法,学习笔记(一)
- 招广告算法、机器学习方面的研发工程师,使用 scala
- POJ 2828 Buy Tickets (单点更新)
- 【Allwinner ClassA20类库分析】 2.free pascal语法及结构简析
- ubuntu 14.04 OpenGL 配置到eclipse IDE 与 makefile文件编写 (基于glut)
- 数的长度nyist
- uml系列(六)——行为图:活动&状态
- HDU 3157 Crazy Circuits(有源汇上下界最小流)