in reply to DNS Lookup

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;

This will return an empty string in $iaddr if $server can not be looked up. If you specify say 127.0.0.1 as the server name $straddr will contain this.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print