6 resolveip - Resolve IP address for given hostname
10 Tries to resolve IP address of given hostname and return its value,
11 returns empty value if unable to detect it.
21 return unless defined $hostname;
23 $packed_ip = gethostbyname($hostname);
24 if (defined $packed_ip) {
25 $ip_address = inet_ntoa($packed_ip);
30 $ip = resolve_ip($hostname);
32 if (not $ip or $ip eq '') {
33 print STDERR "Unable to detect ip address for host: '$hostname'\n";