"whois.cnnic.net.cn", "net.cn"=>"whois.cnnic.net.cn", "org.cn"=>"whois.cnnic.net.cn", "gov.cn"=>"whois.cnnic.net.cn", "cn"=>"whois.cnnic.net.cn", "com"=>"whois.networksolutions.com", "net"=>"whois.networksolutions.com", "org"=>"whois.networksolutions.c" name=description>

InfoQ

交流

讨论:国际域名不能查询?急,在线等!

作者 韩湘子 发布于 0000-00-00 分类:php基础编程

下面是这个域名的查询程序,国内域名啊,别的都能查询,就国际域名查询不了,不管查什么域名都是已经注册了 <? set_time_limit(150); $PORT=43; $MAX_RETRIES=5; $SLEEP_TIME=2; $RETRY=5; $Servers=array( "com.cn"=>"whois.cnnic.net.cn", "net.cn"=>"whois.cnnic.net.cn", "org.cn"=>"whois.cnnic.net.cn", "gov.cn"=>"whois.cnnic.net.cn", "cn"=>"whois.cnnic.net.cn", "com"=>"whois.networksolutions.com", "net"=>"whois.networksolutions.com", "org"=>"whois.networksolutions.com", "biz"=>"whois.nic.biz", "sh"=>"whois.nic.sh", "cc"=>"whois.nic.cc", "tv"=>"whois.networksolutions.com", "info"=>"whois.networksolutions.com", ); $Nomessage=array( "com.cn"=>"no matching record", "net.cn"=>"no matching record", "org.cn"=>"no matching record", "gov.cn"=>"no matching record", "cn"=>"no matching record", "com"=>"to www.netsol.com to register it today!", "net"=>"to www.netsol.com to register it today!", "org"=>"NOT FOUND", "biz"=>"Not found", "sh"=>"no match", "cc"=>"No match", "tv"=>"Registrant", "info"=>"NOT FOUND", ); $y=0; //已注册数 $n=0; //未注册数 $checkmany=sizeof($lastname); //域名名称domain for ($i=0;$i<$checkmany;$i++) { $result=""; $retry=0; while ($retry<=$RETRY) { $host=$lastname[$i]; $ptr=fsockopen($Servers[$host],$PORT); if ($ptr>0) { fputs($ptr,$domain.".".$host."1512"); while (!feof($ptr)) { $result.=fgetc($ptr); } fclose($ptr); $message[$i]=nl2br($result); break; } else { $retry++; sleep($SLEEP_TIME); } } } for ($i=0;$i<$checkmany;$i++) { if (strstr($message[$i],$Nomessage[$lastname[$i]])) { if ($Nomessage[$lastname[$i]]=="Registrant") { $domain_yn[$i]=1; //未注册标志 $y++; //未注册数加1 } else { $domain_yn[$i]=0; //未注册标志 $n++; //未注册数加1 } } else { if ($Nomessage[$lastname[$i]]=="Registrant") { $domain_yn[$i]=0; //已注册标志 $n++; //已注册数加1 } else { $domain_yn[$i]=1; //已注册标志 $y++; //已注册数加1 } } } ?> 域名查询结果
 域名查询
[url]WWW.[/url] . 
com net org
com.cn net.cn org.cn
info biz tv
cc cn  
 
 
 注册域名  

<? if ($y>0) { ?>


<? for ($i=0;$i<$checkmany;$i++) { if ($domain_yn[$i]>0) { ?> <? } } ?>
已注册域名
<? print "www.".$domain.".".$lastname[$i] ?> 不能注册

<? } ?> <? if ($n>0) { ?> <? for ($i=0;$i<$checkmany;$i++) { if ($domain_yn[$i]==0) { ?> <? } } ?>
未注册域名 第二步,选择域名进行注册
<? print "www.".$domain.".".$lastname[$i] ?>
<? } ?>



逛论坛交流国际域名不能查询?急,在线等!

加入书签
digg+,
reddit+,
del.icio.us+,
dzone+

0 条回复

回复




  1. 我有话要讲:(可以匿名发表, 发广告的有多远请滚多远!!!)

    昵称: 请输入验证码:


抢着回答

大虾们~~`能提供一个购物软件吗?

在次感激了

请教编程人员一个问题

请问要学编程是不是要数学很聪明才可以呢?

yellow

[ Full Screen ]

为什么活着

生命在于投入,投入你所热爱的事业中。 要讲究效率,保存,...

当我再爱你的时候

http://www.haodx.com/music/rmopen3?019-rm02/01-22.rm

请教

{ echo" 输入字段不可为空白 "; echo"...

大家帮帮我

谁可以给我段代码。是我可以控制一个网页只有登录用户才可以访问...

字符串与数组之间的转化问题~~~~

为什么将字符串转化成数组时不能用以下方式进行: $str_fil...

免費空間

請問那裡還有免費的網站空間呢?謝謝

请教高人,。。

做个文章发布系统,顺便建个站内搜索,功能是实现将搜索到的关键...

[]