Hello,
was wondering if there is a module or someone may know of a quick means of
convering a IP address to a host/domain address.
this is a snip of code we use to use, but I don't think it works very well any more:
# Covert Host IP Address to domain name IE: [somedomain.com]
$ip = remote_addr();
$n = `nslookup -sil $ip | grep Name`; chomp($n);
$dns_host=substr($n, rindex($n, " ")+1);
$period1=rindex($dns_host,'.');
$period2=rindex($dns_host,'.',$period1-1);
$domain_host = substr($dns_host,$period2+1);
# Now split secondary domain to top level domain
($sec_domain, $top_domain) = split(/\./, $domain_host);
then we could obtain the secondary and top domain names... any other suggestions
would be much appreciated. :)
TIA,
--
Mike<mickalo>Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(985)902-8484
MSN: [EMAIL PROTECTED]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- Re: Convert IP address Mike(mickako)Blezien
- Re: Convert IP address WilliamGunther