Reverse DNS lookup in perl
问题 How do I perform a reverse DNS lookup, that is how do I resolve an IP address to its DNS hostname in Perl? 回答1: gethostbyaddr and similar calls. See http://perldoc.perl.org/functions/gethostbyaddr.html 回答2: If you need more detailed DNS info use the Net::DNS module, here is an example: use Net::DNS; my $res = Net::DNS::Resolver->new; # create the reverse lookup DNS name (note that the octets in the IP address need to be reversed). my $IP = "209.85.173.103"; my $target_IP = join('.', reverse