UseServer can now be used for ip addresses

This commit is contained in:
sparc 2010-08-26 10:23:39 +00:00
parent 4f0adb2132
commit 3a1ab40aa3
3 changed files with 43 additions and 8 deletions

View file

@ -1,3 +1,6 @@
2010/08/26
- UseServer can now be used for ip addresses
2010/08/24
- removed dangerous exec call

View file

@ -94,7 +94,7 @@ Using special whois server
Some registrars can give special access to registered whois gateways
in order to have more fine control against abusing the whois services.
The currently know whois services that offer special acccess are:
The currently known whois services that offer special acccess are:
- ripe
@ -138,6 +138,21 @@ information) using this:
$whois = new Whois();
$whois->UseServer('au','whois-check.ausregistry.net.au');
or:
$whois = new Whois();
$whois->UseServer('be','whois.tucows.com');
to avoid the restrictions imposed by the .be whois server
or:
$whois = new Whois();
$whois->UseServer('ip','whois.apnic.net');
to lookup an ip address at specific whois server (but loosing the
ability to get the results parsed by the appropiate handler)
UseServer can be called as many times as necessary. Please note that
if there is a handler for that domain it will also be called but
returned data from the whois server may be different than the data

View file

@ -107,11 +107,20 @@ class Whois extends WhoisClient
{
// IPv4 Prepare to do lookup via the 'ip' handler
$ip = @gethostbyname($query);
$this->Query['server'] = 'whois.arin.net';
$this->Query['args'] = "n $ip";
if (isset($this->WHOIS_SPECIAL['ip']))
{
$this->Query['server'] = $this->WHOIS_SPECIAL['ip'];
$this->Query['args'] = $ip;
}
else
{
$this->Query['server'] = 'whois.arin.net';
$this->Query['args'] = "n $ip";
$this->Query['file'] = 'whois.ip.php';
$this->Query['handler'] = 'ip';
}
$this->Query['host_ip'] = $ip;
$this->Query['file'] = 'whois.ip.php';
$this->Query['handler'] = 'ip';
$this->Query['query'] = $ip;
$this->Query['tld'] = 'ip';
$this->Query['host_name'] = @gethostbyaddr($ip);
@ -122,9 +131,17 @@ class Whois extends WhoisClient
{
// IPv6 AS Prepare to do lookup via the 'ip' handler
$ip = @gethostbyname($query);
$this->Query['server'] = 'whois.ripe.net';
$this->Query['file'] = 'whois.ip.ripe.php';
$this->Query['handler'] = 'ripe';
if (isset($this->WHOIS_SPECIAL['ip']))
{
$this->Query['server'] = $this->WHOIS_SPECIAL['ip'];
}
else
{
$this->Query['server'] = 'whois.ripe.net';
$this->Query['file'] = 'whois.ip.ripe.php';
$this->Query['handler'] = 'ripe';
}
$this->Query['query'] = $ip;
$this->Query['tld'] = 'ip';
return $this->GetData('',$this->deep_whois);