Allow the hostname to resolve to the sysName, ie Dynamic DNS (#8810)

This commit is contained in:
Richard Mayhew
2018-06-23 22:59:09 +02:00
committed by Neil Lathwood
parent 8c610326e3
commit ab5d17d715
3 changed files with 11 additions and 1 deletions

View File

@@ -1203,6 +1203,11 @@ function format_hostname($device, $hostname = '')
$hostname = $device['sysName'];
}
}
if ($config['force_hostname_to_sysname'] === true && !empty($device['sysName'])) {
if (filter_var($hostname, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) == false && filter_var($hostname, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) == false) {
$hostname = $device['sysName'];
}
}
return $hostname;
}//end format_hostname