use Socket; my $server = "perlmonks.org"; $iaddr = inet_aton($server); die "No server '$server'\n" unless $iaddr; $straddr = inet_ntoa($iaddr); print $straddr, "\n"; # going the other way... $iaddr = inet_aton($straddr); $name = gethostbyaddr($iaddr, AF_INET); print $name;