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