%expand%
}))
#!/usr/bin/perl
use Socket;
$host = shift @ARGV;
die("usage: gethostbyname hostname\n") unless(defined($host));
$packed_ip = gethostbyname($host);
if (defined $packed_ip) {
$ip_address = inet_ntoa($packed_ip);
print "$ip_address\n";
exit 0
} else {
warn "$host not found\n";
exit 1
}
| Bracing against the wind | |
| www.documentroot.com |
|
Wednesday, February 29, 2012
gethostbyname command line
[View/Post Comments] [Digg] [Del.icio.us] [Stumble] |
|
Bloghop:
|
Blogarama
|
Technorati
|
Blogwise