handle case if there is no hostname

This commit is contained in:
mxmehl committed 2023-05-24 11:08:18 +02:00
1 parent 9ec952236f
commit 6109429b21
1 file changed
+5
+5
View File
@@ -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") {