1
|
<?php
|
2
|
/*
|
3
|
* status_unbound.php
|
4
|
*
|
5
|
* part of pfSense (https://www.pfsense.org)
|
6
|
* Copyright (c) 2004-2013 BSD Perimeter
|
7
|
* Copyright (c) 2013-2016 Electric Sheep Fencing
|
8
|
* Copyright (c) 2014-2020 Rubicon Communications, LLC (Netgate)
|
9
|
* All rights reserved.
|
10
|
*
|
11
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
12
|
* you may not use this file except in compliance with the License.
|
13
|
* You may obtain a copy of the License at
|
14
|
*
|
15
|
* http://www.apache.org/licenses/LICENSE-2.0
|
16
|
*
|
17
|
* Unless required by applicable law or agreed to in writing, software
|
18
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
19
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20
|
* See the License for the specific language governing permissions and
|
21
|
* limitations under the License.
|
22
|
*/
|
23
|
|
24
|
##|+PRIV
|
25
|
##|*IDENT=page-status-dns-resolver
|
26
|
##|*NAME=Status: DNS Resolver
|
27
|
##|*DESCR=Allow access to the 'Status: DNS Resolver' page.
|
28
|
##|*MATCH=status_unbound.php*
|
29
|
##|-PRIV
|
30
|
|
31
|
require_once("guiconfig.inc");
|
32
|
|
33
|
$pgtitle = array(gettext("Status"), gettext("DNS Resolver"));
|
34
|
$shortcut_section = "resolver";
|
35
|
|
36
|
include("head.inc");
|
37
|
|
38
|
$infra_cache_entries = array();
|
39
|
$errors = "";
|
40
|
|
41
|
// Check if unbound is enabled and running, bail if not
|
42
|
global $config;
|
43
|
if (!isset($config['unbound']['enable']) || !is_service_running('unbound')) {
|
44
|
print_info_box(gettext("The DNS Resolver is disabled or stopped."), 'warning', false);
|
45
|
} else {
|
46
|
exec("/usr/local/sbin/unbound-control -c {$g['unbound_chroot_path']}/unbound.conf dump_infra", $infra_cache_entries, $ubc_ret);
|
47
|
}
|
48
|
|
49
|
?>
|
50
|
|
51
|
<div class="panel panel-default">
|
52
|
<div class="panel-heading"><h2 class="panel-title"><?=gettext("DNS Resolver Infrastructure Cache Speed")?></h2></div>
|
53
|
<div class="panel-body">
|
54
|
<div class="table-responsive">
|
55
|
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
|
56
|
<thead>
|
57
|
<tr>
|
58
|
<th><?=gettext("Server")?></th>
|
59
|
<th><?=gettext("Zone")?></th>
|
60
|
<th><?=gettext("TTL")?></th>
|
61
|
<th><?=gettext("Ping")?></th>
|
62
|
<th><?=gettext("Var")?></th>
|
63
|
<th><?=gettext("RTT")?></th>
|
64
|
<th><?=gettext("RTO")?></th>
|
65
|
<th><?=gettext("Timeout A")?></th>
|
66
|
<th><?=gettext("Timeout AAAA")?></th>
|
67
|
<th><?=gettext("Timeout Other")?></th>
|
68
|
</tr>
|
69
|
</thead>
|
70
|
<tbody>
|
71
|
<?php if (empty($infra_cache_entries)): ?>
|
72
|
<tr>
|
73
|
<td colspan="10">
|
74
|
<i><?= gettext("No Data") ?></i>
|
75
|
</td>
|
76
|
</tr>
|
77
|
<?php endif; ?>
|
78
|
<?php
|
79
|
foreach ($infra_cache_entries as $ice) {
|
80
|
$line = explode(' ', $ice);
|
81
|
?>
|
82
|
<tr>
|
83
|
<td>
|
84
|
<?=$line[0]?>
|
85
|
</td>
|
86
|
<td>
|
87
|
<?=$line[1]?>
|
88
|
</td>
|
89
|
<?php
|
90
|
if ($line[3] == "expired"):
|
91
|
?>
|
92
|
<td colspan="4">
|
93
|
<?=$line[3]?>
|
94
|
</td>
|
95
|
<td>
|
96
|
<?=$line[5]?>
|
97
|
</td>
|
98
|
<td colspan="4">
|
99
|
|
100
|
</td>
|
101
|
<?php else: ?>
|
102
|
<td>
|
103
|
<?=$line[3]?>
|
104
|
</td>
|
105
|
<td>
|
106
|
<?=$line[5]?>
|
107
|
</td>
|
108
|
<td>
|
109
|
<?=$line[7]?>
|
110
|
</td>
|
111
|
<td>
|
112
|
<?=$line[9]?>
|
113
|
</td>
|
114
|
<td>
|
115
|
<?=$line[11]?>
|
116
|
</td>
|
117
|
<td>
|
118
|
<?=$line[13]?>
|
119
|
</td>
|
120
|
<td>
|
121
|
<?=$line[15]?>
|
122
|
</td>
|
123
|
<td>
|
124
|
<?=$line[17]?>
|
125
|
</td>
|
126
|
</tr>
|
127
|
|
128
|
<?php endif;
|
129
|
}
|
130
|
?>
|
131
|
</tbody>
|
132
|
</table>
|
133
|
</div>
|
134
|
</div>
|
135
|
</div>
|
136
|
|
137
|
<div class="panel panel-default">
|
138
|
<div class="panel-heading"><h2 class="panel-title"><?=gettext("DNS Resolver Infrastructure Cache Stats")?></h2></div>
|
139
|
<div class="panel-body">
|
140
|
<div class="table-responsive">
|
141
|
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
|
142
|
<thead>
|
143
|
<tr>
|
144
|
<th><?=gettext("Server")?></th>
|
145
|
<th><?=gettext("Zone")?></th>
|
146
|
<th><?=gettext("eDNS Lame Known")?></th>
|
147
|
<th><?=gettext("eDNS Version")?></th>
|
148
|
<th><?=gettext("Probe Delay")?></th>
|
149
|
<th><?=gettext("Lame DNSSEC")?></th>
|
150
|
<th><?=gettext("Lame Rec")?></th>
|
151
|
<th><?=gettext("Lame A")?></th>
|
152
|
<th><?=gettext("Lame Other")?></th>
|
153
|
</tr>
|
154
|
</thead>
|
155
|
<tbody>
|
156
|
<?php if (empty($infra_cache_entries)): ?>
|
157
|
<tr>
|
158
|
<td colspan="17">
|
159
|
<i><?= gettext("No Data") ?></i>
|
160
|
</td>
|
161
|
</tr>
|
162
|
<?php endif; ?>
|
163
|
<?php
|
164
|
foreach ($infra_cache_entries as $ice) {
|
165
|
$line = explode(' ', $ice);
|
166
|
?>
|
167
|
<tr>
|
168
|
<td>
|
169
|
<?=$line[0]?>
|
170
|
</td>
|
171
|
<td>
|
172
|
<?=$line[1]?>
|
173
|
</td>
|
174
|
<?php
|
175
|
if ($line[3] == "expired"):
|
176
|
?>
|
177
|
<td colspan="7">
|
178
|
<?=$line[3]?>
|
179
|
|
180
|
</td>
|
181
|
<?php else: ?>
|
182
|
<td>
|
183
|
<?=$line[19]?>
|
184
|
</td>
|
185
|
<td>
|
186
|
<?=$line[21]?>
|
187
|
</td>
|
188
|
<td>
|
189
|
<?=$line[23]?>
|
190
|
</td>
|
191
|
<td>
|
192
|
<?=$line[26]?>
|
193
|
</td>
|
194
|
<td>
|
195
|
<?=$line[28]?>
|
196
|
</td>
|
197
|
<td>
|
198
|
<?=$line[30]?>
|
199
|
</td>
|
200
|
<td>
|
201
|
<?=$line[32]?>
|
202
|
</td>
|
203
|
</tr>
|
204
|
|
205
|
<?php endif;
|
206
|
}
|
207
|
?>
|
208
|
</tbody>
|
209
|
</table>
|
210
|
</div>
|
211
|
</div>
|
212
|
</div>
|
213
|
|
214
|
<?php
|
215
|
include("foot.inc");
|