fix: hostnames returned by discovery protocols with trailing dot (#5571)

This commit is contained in:
Tony Murray
2017-01-24 15:56:51 -06:00
committed by Neil Lathwood
parent 56bb0d2b97
commit ab03af889a
2 changed files with 22 additions and 16 deletions

View File

@@ -648,7 +648,12 @@ function createHost($host, $community, $snmpver, $port = 161, $transport = 'udp'
function isDomainResolves($domain)
{
return (gethostbyname($domain) != $domain || count(dns_get_record($domain)) != 0);
if (gethostbyname($domain) != $domain) {
return true;
}
$records = dns_get_record($domain); // returns array or false
return !empty($records);
}
function hoststatus($id)