handle case if there is no hostname
This commit is contained in:
@@ -189,7 +189,12 @@ function ip2hostname($ip) {
|
||||
return $hostname;
|
||||
}
|
||||
function hostname2ip($hostname) {
|
||||
$ipsbyhostname = gethostbynamel($hostname);
|
||||
if($ipsbyhostname === false) {
|
||||
$ip = $hostname;
|
||||
} else {
|
||||
$ip = implode(', ', gethostbynamel($hostname));
|
||||
}
|
||||
return $ip;
|
||||
}
|
||||
function dnsrecords($hostname, $record = "DNS_ALL") {
|
||||
|
||||
Reference in New Issue
Block a user