in reply to Domain name from ip.
use Net::hostent; use strict; my $host = gethost("209.214.174.80"); print $host->name, "\n";
Remember though that domain resolution is only as good as the domain system - Some IP addresses may not have been set up with PTR records back to fully-qualified domain names.
Update #1 - Another excellent solution might be to use Net::Domain which provides methods not only for IP address resolution, but also hostname and hostdomain for system hostname and domain respectively.
Update #2 - Ugh, Net::Domain is only good for determining this information about the local machine.
perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Domain name from ip.
by dws (Chancellor) on Dec 03, 2001 at 05:23 UTC |