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