Author Topic: Simple php script for WHOIS  (Read 2365 times)

Offline thebestia

  • Trade Count: (1)
  • Newbie
  • *
  • Posts: 47
    • SitoPro.net
    • Email
Simple php script for WHOIS
« on: March 05, 2010, 03:31:48 PM »
ok here a simple script for the whois
 of a domain
Quote
<?php
/*
    example: page.php?s=yahoo.it
*/
$server = array(
"asia" => "whois.nic.asia",
"biz" => "whois.biz",
"com" => "whois.verisign-grs.com",
"coop" => "whois.nic.coop",
"info" => "whois.afilias.net",
"jobs" => "jobswhois.verisign-grs.com",
"mobi" => "whois.dotmobiregistry.net",
"name" => "whois.nic.name",
"net" => "whois.verisign-grs.com",
"org" => "whois.pir.org",
"pro" => "whois.registrypro.pro",
"tel" => "whois.nic.tel",
"travel" => "whois.nic.travel",
"gov" => "whois.dotgov.gov",
"edu" => "whois.educause.edu",
"int" => "whois.iana.org",
"museum" => "whois.museum",
"ac" => "whois.nic.ac",
"ae" => "whois.nic.ae",
"ag" => "whois.nic.ag",
"am" => "whois.amnic.net",
"at" => "whois.nic.at",
"au" => "whois.aunic.net",
"be" => "whois.dns.be",
"bg" => "whois.register.bg",
"bj" => "whois.nic.bj",
"br" => "whois.registro.br",
"ca" => "whois.cira.ca",
"ch" => "whois.nic.ch",
"ci" => "whois.nic.ci",
"cl" => "whois.nic.cl",
"cn" => "whois.cnnic.net.cn",
"cx" => "whois.nic.cx",
"cz" => "whois.nic.cz",
"de" => "whois.denic.de",
"dk" => "whois.dk-hostmaster.dk",
"ee" => "whois.eenet.ee",
"fi" => "whois.ficora.fi",
"fr" => "whois.nic.fr",
"gd" => "whois.adamsnames.com",
"gg" => "whois.channelisles.net",
"gi" => "whois2.afilias-grs.net",
"gs" => "whois.nic.gs",
"gw" => "whois.nic.gw",
"gy" => "whois.registry.gy",
"hk" => "whois.hkirc.hk",
"hn" => "whois2.afilias-grs.net",
"ie" => "whois.domainregistry.ie",
"il" => "whois.isoc.org.il",
"in" => "whois.inregistry.net",
"io" => "whois.nic.io",
"ir" => "whois.nic.ir",
"is" => "whois.isnic.is",
"it" => "whois.nic.it",
"je" => "whois.channelisles.net",
"jp" => "whois.jprs.jp",
"ke" => "whois.kenic.or.ke",
"kg" => "www.domain.kg",
"ki" => "whois.nic.ki",
"kr" => "whois.nic.or.kr",
"kz" => "whois.nic.kz",
"la" => "whois.nic.la",
"li" => "whois.nic.li",
"lt" => "whois.domreg.lt",
"lu" => "whois.dns.lu",
"lv" => "whois.nic.lv",
"ly" => "whois.nic.ly",
"ma" => "whois.iam.net.ma",
"mg" => "whois.nic.mg",
"mn" => "whois.nic.mn",
"ms" => "whois.adamsnames.tc",
"mx" => "whois.nic.mx",
"my" => "whois.mynic.net.my",
"na" => "whois.na-nic.com.na",
"nl" => "whois.domain-registry.nl",
"no" => "whois.norid.no",
"nu" => "whois.nic.nu",
"nz" => "whois.srs.net.nz",
"pl" => "whois.dns.pl",
"pm" => "whois.nic.pm",
"pr" => "whois.uprr.pr",
"re" => "whois.nic.re",
"ro" => "whois.rotld.ro",
"ru" => "whois.ripn.net",
"sa" => "whois.nic.net.sa",
"sb" => "whois.nic.net.sb",
"sc" => "whois2.afilias-grs.net",
"se" => "whois.iis.se",
"sg" => "whois.nic.net.sg",
"sh" => "whois.nic.sh",
"si" => "whois.arnes.si",
"st" => "whois.nic.st",
"tc" => "whois.adamsnames.tc",
"tf" => "whois.nic.tf",
"tk" => "whois.dot.tk",
"tl" => "whois.nic.tl",
"tm" => "whois.nic.tm",
"tr" => "whois.nic.tr",
"tw" => "whois.twnic.net.tw",
"ua" => "whois.net.ua",
"ug" => "whois.co.ug",
"uk" => "whois.nic.uk",
"us" => "whois.nic.us",
"uz" => "whois.cctld.uz",
"vc" => "whois2.afilias-grs.net",
"ve" => "whois.nic.ve",
"vg" => "whois.adamsnames.tc",
"wf" => "whois.nic.wf",
"ws" => "whois.website.ws",
"yt" => "whois.nic.yt");
 
$s = getDomain($_GET['s']);
 
if($s != NULL && $server[$s[1]] != "") {
    $connection = fsockopen($server[$s[1]], 43);
    if (!$connection)
        echo "Errore";
    else {
        $msg = "";
        fputs($connection, $s[0].".".$s[1]."\r\n");
        while (!feof($connection))
            $msg .= fgets($connection, 4096);
 
        fclose($connection);
 
        echo "<pre>".
            $msg
        ."</pre>";
    }
}else
    echo "URL non valido";
 
function getDomain($url) {
    $arrU = explode(".", $url);
    if(count($arrU) >= 2)
        return array($arrU[count($arrU)-2], $arrU[count($arrU)-1]);
    else
        return NULL;
}
?>

Offline suvosaha

  • Trade Count: (1)
  • Newbie
  • *
  • Posts: 44
    • eTechDNA
    • Email
Re: Simple php script for WHOIS
« Reply #1 on: March 07, 2010, 11:17:37 AM »
Thanks Man. Nice Share!! :)

Offline kereviz

  • Trade Count: (0)
  • Newbie
  • *
  • Posts: 4
    • indirelim.org
    • Email
Re: Simple php script for WHOIS
« Reply #2 on: March 09, 2010, 10:58:59 PM »
thanks for sharing

Offline J

  • Trade Count: (0)
  • Jr. Member
  • **
  • Posts: 61
Re: Simple php script for WHOIS
« Reply #3 on: March 15, 2010, 02:53:41 AM »
any demo?

Offline Rams

  • Trade Count: (0)
  • Newbie
  • *
  • Posts: 13
    • Email
Re: Simple php script for WHOIS
« Reply #4 on: March 17, 2010, 12:38:59 PM »
I have no idea what this does.. anyone care to explain the basic functionality? ty

Offline J

  • Trade Count: (0)
  • Jr. Member
  • **
  • Posts: 61
Re: Simple php script for WHOIS
« Reply #5 on: March 17, 2010, 02:01:09 PM »
I have no idea what this does.. anyone care to explain the basic functionality? ty

Its a domain whoIs script, you have to copy and paste the quoted text in the php file,
Its just like whois.net that tells whats the reg date of domain,expiring date of domain,owner name etc,  but much simpler..

Webmaster Forums

Re: Simple php script for WHOIS
« Reply #5 on: March 17, 2010, 02:01:09 PM »