handle case if there is no hostname
This commit is contained in:
1 parent
9ec952236f
commit
6109429b21
1 file changed
+6
-1
@@ -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