[תÔØ]PHP°æÓòÃûwhoisÐÅÏ¢(¹ýÆÚʱ¼ä)²éѯ¹¤¾ß
ÐÞ¸Ä×ÔÍøÉÏÁ÷´«µÄ°æ±¾£¬²¢×÷ÁËÐÞÕý£º
Ôö¼ÓÁËÁ½°Ù¶àÖÖÓòÃûµÄÖ§³Ö£»
ÐÞÕýÁ˹ýÆÚʱ¼ä½âÎö´íÎóµÄBUG£¬¸Ä½øÁËЧÂÊ¡£
<?php if(!isset($_GET['domain'])){ echo "1.Äúδָ¶¨Òª²éѯµÄÓòÃû£¡<br />"; echo "2.½Ó¿ÚʹÓ÷½·¨£º/whois.php?domain=<FONT color=#ff0000>ÓòÃû</FONT><br />"; echo "3.<FONT color=#ff0000>ÓòÃû</FONT>ÇëÎð¼Ó<FONT color=#ff0000>www.</FONT><br />"; exit; } $domain = $_GET['domain']; class SearchDomain { private $arr_whois_servers = array( 'com'=>'whois.internic.net', 'net'=>'whois.internic.net', 'org'=>'whois.pir.org', 'asia'=>'whois.crsnic.net', 'ac'=>'whois.nic.uk', 'ad'=>'whois.nic.ad', 'ae'=>'whois.uaenic.ae', 'ag'=>'whois.nic.ag', 'ai'=>'whois.offshore.com.ai', 'al'=>'whois.inima.al', 'an'=>'whois.una.net', 'ao'=>'whois.fccn.pt', 'aq'=>'whois.nsrc.org', 'ar'=>'whois.nic.ar', 'as'=>'whois.nic.as', 'am'=>'whois.amnic.net', 'au'=>'whois.amnic.net', 'at'=>'whois.amnic.net', 'az'=>'whois.domain.az', 'ba'=>'whois.utic.net.ba', 'bb'=>'whois.domains.org.bb', 'be'=>'whois.dns.be', 'bf'=>'whois.onatel.bf', 'bg'=>'whois.digsys.bg', 'bh'=>'whois.batelco.com.bh', 'bi'=>'whois.nic.bi', 'biz'=>'whois.nic.biz', 'bm'=>'whois.bermudanic.bm', 'bn'=>'whois.brunet.bn', 'bo'=>'whois.digsys.bo', 'by'=>'whois.unibel.by', 'bz'=>'whois.belizenic.bz', 'br'=>'whois.registro.fapesp.br', 'bt'=>'whois.nic.bt', 'bv'=>'whois.norid.no', 'ca'=>'whois.cira.ca', 'cc'=>'whois.nic.cc', 'cd'=>'whois.nic.cd', 'cf'=>'whois.socatel.intnet.cf', 'cg'=>'whois.nic.cg', 'ch'=>'whois.nic.ch', 'ci'=>'whois.aipdi.ci', 'ck'=>'whois.oyster.net.ck', 'cl'=>'whois.nic.cl', 'cm'=>'whois.info.intelcam.cm', 'cn'=>'whois.cnnic.net.cn', 'co'=>'whois.nic.uniandes.edu.co', 'coop'=>'whois.nic.coop', 'cu'=>'whois.nic.cu', 'cx'=>'whois.nic.cx', 'cy'=>'whois.nic.cy', 'cz'=>'whois.nic.cz', 'de'=>'whois.denic.de', 'dk'=>'whois.dk-hostmaster.dk', 'dj'=>'whois.intnet.dj', 'do'=>'whois.nic.do', 'dz'=>'whois.nic.dz', 'ec'=>'whois.nic.ec', 'edu'=>'whois.educause.net', 'ee'=>'whois.eenet.ee', 'eg'=>'whois.frcu.eun.eg', 'es'=>'whois.nic.es', 'et'=>'whois.telecom.net.et', 'fi'=>'whois.ripe.net', 'fj'=>'whois.usp.ac.fj', 'fk'=>'whois.fidc.org.fk', 'fm'=>'whois.dot.fm', 'fo'=>'whois.nic.fo', 'fr'=>'whois.nic.fr', 'gb'=>'whois.nic.uk', 'ge'=>'whois.nic.net.ge', 'gf'=>'whois.nplus.gf', 'gg'=>'whois.nic.gg', 'gh'=>'whois.ghana.com', 'gi'=>'whois.gibnet.gi', 'gl'=>'whois.nic.gl', 'gm'=>'whois.nic.gm', 'gn'=>'whois.psg.com', 'gov'=>'whois.nic.gov', 'gp'=>'whois.nic.gp', 'gq'=>'whois.getesa.gq', 'gr'=>'whois.hostmaster.gr', 'gs'=>'whois.adamsnames.tc', 'gt'=>'whois.uvg.edu.gt', 'gu'=>'whois.gadao.gov.gu', 'hk'=>'whois.hkdnr.net.hk', 'hm'=>'whois.registry.hm', 'hn'=>'whois.nic.hn', 'hr'=>'whois.carnet.hr', 'hu'=>'whois.nic.hu', 'id'=>'whois.idnet.net.id', 'ie'=>'whois.domainregistry.ie', 'il'=>'whois.isoc.org.il', 'im'=>'whois.nic.im', 'in'=>'whois.domain.ncst.ernet.in', 'info'=>'whois.afilias.com', 'int'=>'whois.iana.org', 'io'=>'whois.nic.io', 'ir'=>'whois.nic.ir', 'is'=>'whois.isnic.is', 'it'=>'whois.nic.it', 'je'=>'whois.isles.net', 'jo'=>'whois.nic.net.jo', 'jp'=>'whois.nic.ad.jp', 'ke'=>'whois.nbnet.co.ke', 'kg'=>'whois.domain.kg', 'kh'=>'whois.mptc.gov.kh', 'kn'=>'whois.clu.edu', 'kr'=>'whois.nic.or.kr', 'kw'=>'whois.domainname.net.kw', 'kz'=>'whois.domain.kz', 'lb'=>'whois.aub.edu.lb', 'lc'=>'whois.isisworld.lc', 'li'=>'whois.nic.li', 'lk'=>'whois.nic.lk', 'lr'=>'whois.psg.com', 'ls'=>'whois.co.ls', 'lt'=>'whois.domreg.lt', 'lu'=>'whois.dns.lu', 'lv'=>'whois.nic.lv', 'ly'=>'whois.nic.ly', 'ma'=>'whois.iam.ma', 'mc'=>'whois.nic.mc', 'md'=>'whois.ripe.net', 'mil'=>'whois.nic.mil', 'mg'=>'whois.orstom.mg', 'mh'=>'whois.nic.net.mh', 'mk'=>'whois.mpt.com.mk', 'mm'=>'whois.nic.mm', 'mn'=>'whois.nic.mn', 'mo'=>'whois.umac.mo', 'mp'=>'whois.marketplace.mp', 'mq'=>'whois.nic.mq', 'mr'=>'whois.univ-mkc.mr', 'ms'=>'whois.adamsnames.tc', 'mt'=>'whois.um.edu.mt', 'mu'=>'whois.posix.co.za', 'mw'=>'whois.tarsus.net', 'mx'=>'whois.nic.mx', 'my'=>'whois.mynic.net.my', 'mz'=>'whois.nambu.uem.mz', 'na'=>'na-nic.com.na', 'name'=>'whois.nic.name', 'nc'=>'whois.norstom.nc', 'nf'=>'whois.names.nf', 'ni'=>'whois.nic.ni', 'nl'=>'whois.domain-registry.nl', 'no'=>'whois.norid.no', 'np'=>'whois.mos.com.np', 'nu'=>'whois.nic.nu', 'nz'=>'whois.domainz.net.nz', 'om'=>'whois.gto.net.om', 'pa'=>'whois.nic.pa', 'pe'=>'whois.ekeko.rcp.net.pe', 'ph'=>'whois.domreg.org.ph', 'pg'=>'whois.unitech.ac.pg', 'pk'=>'whois.pknic.net.pk', 'pl'=>'whois.nask.pl', 'pm'=>'whois.nic.pm', 'pn'=>'whois.nic.pn', 'pr'=>'whois.uprr.pr', 'ps'=>'whois.nic.ps', 'pt'=>'whois.fccn.pt', 'py'=>'whois.nic.py', 'qa'=>'whois.qatar.net.qa', 're'=>'whois.nic.fr', 'ro'=>'whois.rnc.ro', 'ru'=>'whois.ripn.net', 'rw'=>'whois.nic.rw', 'sa'=>'whois.saudinic.net.sa', 'sb'=>'whois.sbnic.net.sb', 'sd'=>'whois.sudatel.sd', 'se'=>'whois.nic-se.se', 'sg'=>'whois.nic.net.sg', 'sh'=>'whois.nic.sh', 'si'=>'whois.arnes.si', 'sj'=>'whois.norid.no', 'sk'=>'whois.sk-nic.sk', 'sm'=>'whois.intelcom.sm', 'sn'=>'whois.nic.sn', 'so'=>'whois.nic.so', 'st'=>'whois.st-registry.tecnisys.net', 'su'=>'whois.ripn.net', 'sv'=>'whois.svnet.org.sv', 'sz'=>'whois.iafrica.sz', 'tc'=>'whois.adamsnames.tc', 'td'=>'whois.tit.td', 'tf'=>'whois.adamsnames.tc', 'tg'=>'whois.nic.tg', 'th'=>'whois.thnic.net', 'tj'=>'whois.nic.tj', 'tm'=>'whois.nic.tm', 'tn'=>'whois.ati.tn', 'to'=>'whois.tonic.to', 'tp'=>'whois.nic.tp', 'tr'=>'whois.metu.edu.tr', 'tt'=>'whois.nic.tt', 'tw'=>'whois.twnic.net', 'tz'=>'whois.psg.com', 'tv'=>'whois.networksolutions.com', 'ua'=>'nic.net.ua', 'ug'=>'whois.nic.ug', 'uk'=>'whois.nic.uk', 'uk'=>'whois.ripe.net', 'um'=>'whois.isi.edu', 'us'=>'whois.nic.us', 'uy'=>'whois.rau.edu.uy', 'uz'=>'whois.freenet.uz', 've'=>'whois.nic.ve', 'wf'=>'whois.nic.fr', 'vg'=>'whois.adamsnames.tc', 'vi'=>'whois.nic.vi', 'vn'=>'whois.batin.com.vn', 'vu'=>'whois.vunic.vu', 'ws'=>'samoanic.ws', 'yt'=>'whois.nic.fr', 'yu'=>'whois.nic.yu', 'za'=>'whois.co.za', 'zm'=>'whois.zamnet.zm', ); public $domain=""; function SetDomain($udomain) { $this->domain = $udomain; } function GetInfo() { $wl = ""; $w_server = $this->GetServer(); if($w_server=="") return ""; $fp = fsockopen($w_server, 43, $errno, $errstr, 30); if(!$fp) { echo $errstr; return ""; } $out = $this->domain.""; $out .= "Connection: Close"; fputs($fp, $out); while (!feof($fp)) { $wl = fgets($fp, 255); if(preg_match("/no match/",$wl)) { fclose($fp); return "ok"; } if(preg_match("/Expiration Date/",$wl)) { $lines = explode(":",$wl); $t = trim($lines[1]); $ts = explode(" ",$t); $t = $ts[0]; if(preg_match("/[^0-9-]/",$t)) { return date("Y-m-d",strtotime($t)); } fclose($fp); return ''; } } fclose($fp); return ""; } // //»ñµÃÓòÃûµÄÕû¸öwhoisÐÅÏ¢ // function GetWhois() { $wh = ""; $w_server = $this->GetServer(); if($w_server=="") return ""; $fp = fsockopen($w_server, 43, $errno, $errstr, 30); if(!$fp) { echo $errstr; return ""; } $out = $this->domain.""; $out .= "Connection: Close"; fputs($fp, $out); while (!feof($fp)) { $wh .= nl2br(fgets($fp, 255)); } fclose($fp); return $wh; } // //Êä³öµ±Ç°ÓòÃûµÄ״̬ÐÅÏ¢ // function PrintSta() { $rs = $this->GetInfo(); if($rs=="ok") echo $this->domain." δע²á£¡<br/>"; else if($rs=="") echo "ÎÞ·¨²éѯ ".$this->domain." ״̬£¡<br/>"; else echo $this->domain." ÒÑ×¢²á£¬µ½ÆÚʱ¼ä£º$rs<br/>"; } // //»ñµÃ whois ²éѯ·þÎñÆ÷ // function GetServer() { $udomain=strtolower(substr(strrchr($this->domain,'.'),1)); return array_key_exists($udomain,$this->arr_whois_servers) ? $this->arr_whois_servers[$udomain] : ''; } // //Ó¢ÓïµÄÔ·ÝתΪÊý×Ö // function MonthToNum($m) { echo $m; $m = strtolower($m); for($i=1;$i<=12;$i++) { $tt = mktime(0,0,0,$i+1,0,2005); if($m==strtolower(strftime("%b",$tt))) { if($i>9) return $i-1; else return "0".$i-1; } } } } $sd = new SearchDomain(); $sd->SetDomain("$domain"); //²éѯÓòÃûÊÇ·ñ±»×¢²á£¬µÈ¼ÛÓÚ $sd->PrintSta(); $rs = $sd->GetInfo(); if($rs=="ok") echo $sd->domain." δע²á£¡<br/>"; else if($rs=="") echo "ÎÞ·¨²éѯ ".$sd->domain." ״̬£¡<br/>"; else echo $sd->domain." ÒÑ×¢²á£¬µ½ÆÚʱ¼ä£º$rs<br/>"; //»ñµÃÓòÃûµÄÏêϸwhoisÐÅÏ¢ //echo $sd->GetWhois(); ?>Çë×¢Ò⣺¾½øÒ»²½Ê¹Ó÷¢ÏÖÉÏÃæµÄwhois server·µ»ØµÄ²¢²»ÊÇͳһ¸ñʽµÄÐÅÏ¢£¬²¢ÇÒ²¿·Öwhois serverÎÞÏìÓ¦¡£²¿·ÖСºó׺ÓòÃûÊÇÎÞ·¨²éѯµÄ£¬»¹ÐèÒª½øÒ»²½´¦Àí¡££¨¾ÙÀý£¬.kr·µ»Øº«ÎÄÊý¾Ý£¬.fr,.de·µ»ØijÖÖÐÒéµÄ¸ñʽ£¬¶ø.ru·µ»ØÁËÁí Ò»ÖÖ¸ñʽµÄÐÒ飬˵Ã÷Ò³ÃæÊǶíÎĵġ££©
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ