Sorry. I forgot which Forum I was in. try this
use strict;
use Net::hostent;
use Socket;
my $h;
my $destaddr;
my $a;
if ( $#ARGV < 0 )
{
printf("$0 ipaddress ... \n");
exit;
}
foreach $destaddr ( @ARGV )
{
# must translate w.x.y.z string to 4 binary characters
$a = inet_aton($destaddr);
$h = gethostbyaddr($a);
if ( defined ($h) )
{
printf("%s resolved to %s\n",$destaddr,$h->name);
}
else
{
printf("%s can't be resolved\n",$destaddr);
}
}