Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
foreach $host (@ARGV) { ($name, $aliases, $addrtype, $length, @addrs) = gethostbyname($host); #gethostbyname IS A PERL print "$host:\n"; foreach $a (@addrs) { $i = join(".", unpack("C4", $a)); if( ! $i ) { print ">>>>>>$i<<<<<<\n"; print "NOT FOUND\n"; } else { print "$i\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get server name from ip address
by Fletch (Bishop) on Apr 09, 2004 at 17:24 UTC | |
|
Re: Get server name from ip address
by eXile (Priest) on Apr 09, 2004 at 17:52 UTC |