in reply to DNS resolver

Are you just trying to get the host/domain name? Since you already have the IP address (from STDIN), this will print the host/domain name:
#/usr/bin/perl use warnings; use strict; use Socket; print "Ip address "; my $ipaddr = <STDIN>; my $peer_host = gethostbyaddr(inet_aton($ipaddr), AF_INET); print $peer_host;
Obviously, you'll want to validate the IP address.

The errors were caused by inet_ntoa expecting a packed IP address for an argument.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.