1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26-27--28 29---30 31--32 33 34 35 36 37 38-39 40 41 42 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
function Whois_query ($domain) {//fix the domain name: $domain = Strtolower (Trim ($domain)); $domain = Preg_replace ('/^ht tp:///i ', ', $domain); $domain = preg_replace ('/^www./i ', ', ', $domain); $domain = explode ('/', $domain); $domain = Trim ($domain [0]); Split the TLD from domain name $_domain = explode ('. ', $domain); $lst = count ($_domain)-1; $ext = $_domain[$lst]; For your Find lists//like this 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.co" Op "," Info "=>" Whois.nic.info "," name "=>" Whois.nic.name "," net "=>" Whois.internic.net "," gov "=>" Whois.ni " C.gov "," edu "=>" whois.internic.net "," Mil "=>" rs.internic.net "," int "=>" whois.iana.org "," AC "=>" WHOIS.N " Ic.ac "," AE "=>" whois.uaenic.ae "," at "=>" whois.ripe.net "," au "=>" whois.aunic.net "," being "=>" whois.dns.be " , "BG" => "WhoiS.ripe.net "," BR "=>" whois.registro.br "," BZ "=>" Whois.belizenic.bz "," Ca "=>" whois.cira.ca "," CC "=>" WHOI " s.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 ($servers [$ext])) {die (' error:no matching NIC server found! ');} $nic _server = $servers [$ext]; $output = '; Connect to whois server:if ($conn = Fsockopen ($nic _server)) {fputs ($conn, $domain.) RN "); while (!feof ($conn)) {$output. = fgets ($conn, 128);} fclose ($conn); else {die (' error:could not connECT to '. $nic _server. '!'); return $output; }//Some example Queries:print whois_query (' jonasjohn.de '); Print whois_query (' example.com '); Print whois_query (' example.org '); |