diff --git a/Changes.md b/Changes.md index e74ceaf..a227e82 100644 --- a/Changes.md +++ b/Changes.md @@ -1,5 +1,6 @@ 2006/03/29 David Saez - fixed bad rwhois server/port detection + - added optional suport for non ICANN tld's 2006/03/24 David Saez - added handler for NAMESDIRECT diff --git a/example.php b/example.php index 05e142a..b096143 100644 --- a/example.php +++ b/example.php @@ -56,6 +56,9 @@ if(isSet($_GET['query'])) //$whois->UseServer('uk','whois.nic.uk:1043?{hname} {ip} {query}'); //$whois->UseServer('au','whois-check.ausregistry.net.au'); + // uncomment the following line to add support for non ICANN tld's + // $whois->non_icann = true; + $result = $whois->Lookup($query); echo "
Results for $query :

"; diff --git a/src/whois.main.php b/src/whois.main.php index 697416b..06159bd 100755 --- a/src/whois.main.php +++ b/src/whois.main.php @@ -38,6 +38,9 @@ class Whois extends WhoisClient // Recursion allowed ? var $gtld_recurse = true; + // Support for non-ICANN tld's + var $non_icann = false; + // Network Solutions registry server var $NSI_REGISTRY = "whois.nsiregistry.net"; @@ -118,15 +121,20 @@ class Whois extends WhoisClient // Search the correct whois server + if ($this->non_icann) + $special_tlds = array_merge($this->WHOIS_SPECIAL,$this->WHOIS_NON_ICANN); + else + $special_tlds = $this->WHOIS_SPECIAL; + foreach($tldtests as $tld) { // Test if we know in advance that no whois server is // available for this domain and that we can get the // data via http or whois request - if (isset($this->WHOIS_SPECIAL[$tld])) + if (isset($special_tlds[$tld])) { - $val = $this->WHOIS_SPECIAL[$tld]; + $val = $special_tlds[$tld]; $domain = substr($query, 0, - strlen($tld) - 1); $val = str_replace('{domain}', $domain, $val); $server = str_replace('{tld}', $tld, $val); diff --git a/src/whois.servers.php b/src/whois.servers.php index e81a6eb..646d671 100644 --- a/src/whois.servers.php +++ b/src/whois.servers.php @@ -119,4 +119,103 @@ $this->WHOIS_SPECIAL = array( 'za.org' => 'whois.za.net' ); +/* Non ICANN TLD's */ + +$this->WHOIS_NON_ICANN = array ( + 'agent' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'agente' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'america' => 'http://www.adns.net/whois.php?txtDOMAIN={domain}.{tld}', + 'amor' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'amore' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'amour' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'arte' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'artes' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'arts' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'asta' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'auction' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'auktion' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'boutique' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'chat' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'chiesa' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'church' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'cia' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'ciao' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'cie' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'club' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'clube' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'com2' => 'http://www.adns.net/whois.php?txtDOMAIN={domain}.{tld}', + 'deporte' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'ditta' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'earth' => 'http://www.adns.net/whois.php?txtDOMAIN={domain}.{tld}', + 'eglise' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'enchere' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'escola' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'escuela' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'esporte' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'etc' => 'http://www.adns.net/whois.php?txtDOMAIN={domain}.{tld}', + 'famiglia' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'familia' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'familie' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'family' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'free' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'hola' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'game' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'ges' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'gmbh' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'golf' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'gratis' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'gratuit' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'iglesia' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'igreja' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'inc' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'jeu' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'jogo' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'juego' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'kids' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'kirche' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'krunst' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'law' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'legge' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'lei' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'leilao' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'ley' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'liebe' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'lion' => 'http://www.adns.net/whois.php?txtDOMAIN={domain}.{tld}', + 'llc' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'llp' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'loi' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'loja' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'love' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'ltd' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'makler' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'med' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'mp3' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'not' => 'http://www.adns.net/whois.php?txtDOMAIN={domain}.{tld}', + 'online' => 'http://www.adns.net/whois.php?txtDOMAIN={domain}.{tld}', + 'recht' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'reise' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'resto' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'school' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'schule' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'scifi' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'scuola' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'shop' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'soc' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'spiel' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'sport' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'subasta' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'tec' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'tech' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'tienda' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'travel' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'turismo' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'usa' => 'http://www.adns.net/whois.php?txtDOMAIN={domain}.{tld}', + 'verein' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'viaje' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'viagem' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'video' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'voyage' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'xxx' => 'http://www.new.net/search_whois.tp?domain={domain}&tld={tld}', + 'z' => 'http://www.adns.net/whois.php?txtDOMAIN={domain}.{tld}' + ); ?>