Fix PTR lookups on diag_dns.php. Ticket #6561

This commit is contained in:
Chris Buechler 2016-07-06 16:34:52 -05:00
parent ce9130bc2e
commit a9b6c19aeb

View File

@ -192,10 +192,13 @@ if ($_POST) {
if (!$input_errors) {
if (is_ipaddr($host)) {
$type = "ip";
$resolved = gethostbyaddr($host);
$resolvedptr = gethostbyaddr($host);
$ipaddr = $host;
if ($host != $resolved) {
$hostname = $resolved;
if ($host != $resolvedptr) {
$tmpresolved = array();
$tmpresolved['type'] = "PTR";
$tmpresolved['data'] = $resolvedptr;
$resolved[] = $tmpresolved;
}
} elseif (is_hostname($host)) {
$type = "hostname";