diff options
author | Renato Botelho <renato@netgate.com> | 2016-09-13 09:37:27 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-09-13 09:37:27 -0300 |
commit | 0417767d0565a15744bad993cc38cf920b3ef345 (patch) | |
tree | f802468fa7eea289fe7c6d44ce51a621d6ff5ef4 /src/usr | |
parent | 03505b3aba440e0c0c72493b14500abf7aac2c1d (diff) | |
parent | df7f65a318f407b30627eabe77052d7d0b857786 (diff) | |
download | pfsense-0417767d0565a15744bad993cc38cf920b3ef345.zip pfsense-0417767d0565a15744bad993cc38cf920b3ef345.tar.gz |
Merge pull request #3129 from NewEraCracker/patch-dns
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/diag_dns.php | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php index 9779d71..bb44e73 100644 --- a/src/usr/local/www/diag_dns.php +++ b/src/usr/local/www/diag_dns.php @@ -62,7 +62,7 @@ function resolve_host_addresses($host) { } } error_reporting($errreporting);// restore original php warning/error settings. - + foreach ($dnsresult as $item) { $newitem = array(); $newitem['type'] = $item['type']; @@ -79,7 +79,6 @@ function resolve_host_addresses($host) { $newitem['data'] = $item['ipv6']; $resolved[] = $newitem; break; - } } return $resolved; @@ -152,7 +151,7 @@ if ($_POST) { } $type = "unknown"; - $resolved = ""; + $resolved = array(); $ipaddr = ""; if (!$input_errors) { if (is_ipaddr($host)) { @@ -167,26 +166,15 @@ if ($_POST) { } } elseif (is_hostname($host)) { $type = "hostname"; - $resolved = gethostbyname($host); - if ($host != $resolved) { - $resolved = resolve_host_addresses($host); - foreach ($resolved as $item) { - if ($item['type'] == 'A') { - $ipaddr = $item['data']; - break; - } - } - } - } - - if ($host == $resolved) { - $resolved = gettext("No record found"); + $ipaddr = gethostbyname($host); + $resolved = resolve_host_addresses($host); } } } -if (($_POST['host']) && ($_POST['dialog_output'])) { - display_host_results ($host, $resolved, $dns_speeds); +if ($_POST['host'] && $_POST['dialog_output']) { + $host = (isset($resolvedptr) ? $resolvedptr : $host); + display_host_results ($ipaddr, $host, $dns_speeds); exit; } @@ -268,7 +256,7 @@ if (!$input_errors && $type) { <div class="panel panel-default"> <div class="panel-heading"><h2 class="panel-title"><?=gettext('Results')?></h2></div> <div class="panel-body"> - + <table class="table"> <thead> <tr> |