mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Merge pull request #3129 from NewEraCracker/patch-dns
This commit is contained in:
commit
0417767d05
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user