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'
In reply to Re: Domain name from ip.
by rob_au
in thread Domain name from ip.
by blax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |