phpWhois.org/utils.whois

138 lines
4.8 KiB
Text
Raw Normal View History

2002-10-11 12:54:55 +00:00
<?php
2002-10-08 16:49:26 +00:00
2002-10-11 12:54:55 +00:00
/*
Whois2.php PHP classes to conduct whois queries
Copyright (C)1999,2000 easyDNS Technologies Inc. & Mark Jeftovic
Maintained by Mark Jeftovic <markjr@easydns.com>
For the most recent version of this package:
http://www.easydns.com/~markjr/whois2/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2002-10-08 16:49:26 +00:00
*/
/* utils.whois 1.0 Colin Viebrock <cmv@easydns.com> 1999/12/06 */
/* 1.1 Mark Jeftovic <markjr@easydns.com> 1999/12/15 */
class utils extends Whois {
2002-10-11 12:54:55 +00:00
var $REGISTRARS = array(
"ac" => "http://www.nic.ac/cgi-bin/whois",
"ad" => "http://www.nic.ad/",
"ar" => "http://www.nic.ar/consultas/consdom.htm",
"as" => "http://www.nic.as/ASWhois.html",
"at" => "http://whois.aco.net/",
"au" => "http://www.aunic.net/namestatus.html",
"be" => "http://www.DNS.BE/domain-info/info.html",
"br" => "http://registro.fapesp.br/cgi-bin/nicbr/domainsearch",
"ca" => "http://www.cdnnet.ca/",
"ch" => "http://www.switch.ch/domain/search_form.html",
"ci" => "http://whois.nic.ci",
"cl" => "http://sunsite.dcc.uchile.cl/cgi-bin/dom-CL",
"cr" => "http://www.nic.cr/consulta-dns.html",
"cx" => "http://whois.nic.cx/",
"cz" => "gopher://gopher.eunet.cz:70/00/cz-info/cz.list",
"de" => "http://www.nic.de/servlet/Whois",
"dk" => "http://www.dk.net/nic/resIPno.html",
"es" => "http://www.nic.es/whois/",
"fi" => "http://www.thk.fi/englanti/internet/n2579.htm",
"fm" => "http://www.dot.fm/search.html",
"fr" => "http://www.nic.fr/info/whois.html",
"ge" => "http://georgia.net.ge/domain/",
"gi" => "http://www.gibnet.gi/nic/domains.html",
"gr" => "http://pythia.ics.forth.gr/cgi-bin/webwhois",
"hm" => "http://www.nic.hm/whois.html",
"hr" => "http://ds.carnet.hr/whois/diggere.html",
"ie" => "http://www.ucd.ie/hostmaster/dom-list.html",
"im" => "http://www.nic.im/exist.html",
"io" => "http://www.io.io/whois.html",
"is" => "http://www.isnet.is/en/sites.html",
"it" => "http://www.nis.garr.it/cgi-bin/HY/rc?/who/conf",
"jp" => "http://www.nic.ad.jp/cgi-bin/whois_gate",
"kr" => "http://www.krnic.net/cgi-bin/whois",
"kz" => "http://www.domain.kz/search",
"li" => "http://www.switch.ch/domain/search_form.html",
"lk" => "http://www.nic.lk/cgi-bin/whois",
"lt" => "http://vingis.sc-uni.ktu.lt/cgi-bin/whoisnoc?",
"lu" => "http://www.domain-registration.lu/whois.html",
"mm" => "http://www.nic.mm/whois.html",
"mt" => "http://www.um.edu.mt/nic/dir/",
"mx" => "http://www.nic.mx:81/cgi/db/dom",
"nl" => "http://www.domain-registry.nl/NLwhois.html",
"nu" => "http://www.nunames.nu",
"nz" => "http://servius.waikato.ac.nz/isocnz/nz-domain/DNSquery.html",
"pa" => "http://www.nic.pa/indice2.html",
"pe" => "http://ekeko.rcp.net.pe/rcp/PE-NIC/busqueda.html",
"pk" => "http://www.pknic.net.pk/pknic/assigned.htm",
"pt" => "http://www.fccn.pt/dns/pt.html",
"ru" => "http://www.ripn.net/nic/NICHomePage.html",
"se" => "http://www.sunet.se/domreg/",
"sg" => "http://www.nic.net.sg/sgnametk.htm",
"sk" => "http://www.eunet.sk/sk-nic/",
"st" => "http://www.nic.sh/cgi-bin/whois",
"th" => "http://www.thnic.net/whois.html",
"tm" => "http://www.nic.tm/cgi-bin/search",
"to" => "http://www.tonic.to/newname.htm",
"tw" => "http://www.twnic.net/ipdomain.html",
"uk" => "http://www.pipex.net/~guyd/rwhois.html",
"us" => "http://www.isi.edu:80/in-notes/usdnr/rwhois.html",
"ve" => "http://www.nic.ve/nicwho01.html",
"yu" => "http://ubbg.etf.bg.ac.yu/yu-tld/domains.html",
2003-03-04 21:39:28 +00:00
"za" => "http://co.za/whois.shtml"
2002-10-11 12:54:55 +00:00
);
function getRegistrar($cc) {
$cc = trim(strtolower($cc));
$temp = $this->REGISTRARS;
if ($temp[$cc]) {
return $temp[$cc];
} else {
return false;
}
2002-10-08 16:49:26 +00:00
}
2002-10-11 12:54:55 +00:00
// showObject() and debugObject()
// - debug code to show an object or array
2002-10-08 16:49:26 +00:00
2002-10-11 12:54:55 +00:00
function showObject(&$obj) {
$r = $this->debugObject($obj);
echo "<PRE>".$r."</PRE>\n";
}
2002-10-08 16:49:26 +00:00
2002-10-11 12:54:55 +00:00
function debugObject($obj,$indent=0) {
if (is_Array($obj) || is_Object($obj)) {
2002-12-16 20:44:38 +00:00
$return = "";
2002-10-11 12:54:55 +00:00
while (list($k,$v)=each($obj)) {
for ($i=0;$i<$indent;$i++) {
$return .= "&nbsp;";
}
$return .= $k."->".$v."\n";
$return .= $this->debugObject($v,$indent+1);
}
return $return;
}
}
function ns_rr_defined($query) {
return checkdnsrr($query,"NS");
}
2002-10-08 16:49:26 +00:00
}
2002-10-11 12:54:55 +00:00
?>