in reply to Reverse DNS lookup on a list of ip addresses
use Socket; foreach my $key ( keys %report ) { my $hostname="-= Not in DNS =-"; $hostname=gethostbyaddr(inet_aton($key), AF_INET) or $hostname="-= Not in DNS =-"; if ( $report{$key} > 0 ) { print "-=" x 2, " Host: $key ( $hostname )", "-=" x 2, "\n"; } else { print "ERROR Why is this in hash? $key\n"; } }
|
|---|