1 |
7ed0e844
|
Warren Baker
|
<?php
|
2 |
|
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
|
|
services_unbound.php
|
5 |
c7281770
|
Chris Buechler
|
part of the pfSense project (https://www.pfsense.org)
|
6 |
fff4a9d1
|
Warren Baker
|
Copyright (C) 2014 Warren Baker (warren@pfsense.org)
|
7 |
7ed0e844
|
Warren Baker
|
All rights reserved.
|
8 |
|
|
|
9 |
|
|
Redistribution and use in source and binary forms, with or without
|
10 |
fff4a9d1
|
Warren Baker
|
modification, are permitted provided that the following conditions are met:
|
11 |
7ed0e844
|
Warren Baker
|
|
12 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
13 |
|
|
this list of conditions and the following disclaimer.
|
14 |
|
|
|
15 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
16 |
|
|
notice, this list of conditions and the following disclaimer in the
|
17 |
|
|
documentation and/or other materials provided with the distribution.
|
18 |
|
|
|
19 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
20 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
21 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
22 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
23 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
24 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
25 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
26 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
27 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
29 |
|
|
*/
|
30 |
|
|
/*
|
31 |
80948260
|
Warren Baker
|
pfSense_MODULE: dnsresolver
|
32 |
7ed0e844
|
Warren Baker
|
*/
|
33 |
|
|
|
34 |
|
|
##|+PRIV
|
35 |
|
|
##|*IDENT=page-services-unbound
|
36 |
|
|
##|*NAME=Services: DNS Resolver page
|
37 |
|
|
##|*DESCR=Allow access to the 'Services: DNS Resolver' page.
|
38 |
|
|
##|*MATCH=services_unbound.php*
|
39 |
|
|
##|-PRIV
|
40 |
|
|
|
41 |
|
|
require_once("guiconfig.inc");
|
42 |
|
|
require_once("unbound.inc");
|
43 |
|
|
|
44 |
|
|
$pconfig['enable'] = isset($config['unbound']['enable']);
|
45 |
16da09a2
|
Warren Baker
|
$pconfig['port'] = $config['unbound']['port'];
|
46 |
188609c6
|
Warren Baker
|
if (empty($config['unbound']['active_interface']))
|
47 |
|
|
$pconfig['active_interface'] = array();
|
48 |
|
|
else
|
49 |
|
|
$pconfig['active_interface'] = explode(",", $config['unbound']['active_interface']);
|
50 |
|
|
if (empty($config['unbound']['outgoing_interface']))
|
51 |
|
|
$pconfig['outgoing_interface'] = array();
|
52 |
|
|
else
|
53 |
|
|
$pconfig['outgoing_interface'] = explode(",", $config['unbound']['outgoing_interface']);
|
54 |
7ed0e844
|
Warren Baker
|
$pconfig['dnssec'] = isset($config['unbound']['dnssec']);
|
55 |
|
|
$pconfig['forwarding'] = isset($config['unbound']['forwarding']);
|
56 |
|
|
$pconfig['regdhcp'] = isset($config['unbound']['regdhcp']);
|
57 |
|
|
$pconfig['regdhcpstatic'] = isset($config['unbound']['regdhcpstatic']);
|
58 |
1b6e3c30
|
Warren Baker
|
$pconfig['txtsupport'] = isset($config['unbound']['txtsupport']);
|
59 |
7ed0e844
|
Warren Baker
|
|
60 |
188609c6
|
Warren Baker
|
if (!is_array($config['unbound']))
|
61 |
7ed0e844
|
Warren Baker
|
$config['unbound'] = array();
|
62 |
|
|
$a_unboundcfg =& $config['unbound'];
|
63 |
|
|
|
64 |
|
|
if (!is_array($config['unbound']['hosts']))
|
65 |
|
|
$config['unbound']['hosts'] = array();
|
66 |
|
|
$a_hosts =& $config['unbound']['hosts'];
|
67 |
|
|
|
68 |
|
|
if (!is_array($config['unbound']['domainoverrides']))
|
69 |
|
|
$config['unbound']['domainoverrides'] = array();
|
70 |
|
|
$a_domainOverrides = &$config['unbound']['domainoverrides'];
|
71 |
|
|
|
72 |
|
|
if ($_POST) {
|
73 |
|
|
|
74 |
0786eb3a
|
Warren Baker
|
$pconfig = $_POST;
|
75 |
7ed0e844
|
Warren Baker
|
unset($input_errors);
|
76 |
|
|
|
77 |
|
|
if ($_POST['enable'] == "yes" && isset($config['dnsmasq']['enable']))
|
78 |
|
|
$input_errors[] = "The system dns-forwarder is still active. Disable it before enabling the DNS Resolver.";
|
79 |
|
|
|
80 |
|
|
if (empty($_POST['active_interface']))
|
81 |
|
|
$input_errors[] = "A single network interface needs to be selected for the DNS Resolver to bind to.";
|
82 |
|
|
|
83 |
fff4a9d1
|
Warren Baker
|
if (empty($_POST['outgoing_interface']))
|
84 |
|
|
$input_errors[] = "A single outgoing network interface needs to be selected for the DNS Resolver to use for outgoing DNS requests.";
|
85 |
|
|
|
86 |
7ed0e844
|
Warren Baker
|
if ($_POST['port'])
|
87 |
|
|
if (is_port($_POST['port']))
|
88 |
|
|
$a_unboundcfg['port'] = $_POST['port'];
|
89 |
|
|
else
|
90 |
|
|
$input_errors[] = gettext("You must specify a valid port number.");
|
91 |
|
|
else if (isset($config['unbound']['port']))
|
92 |
|
|
unset($config['unbound']['port']);
|
93 |
|
|
|
94 |
|
|
$a_unboundcfg['enable'] = ($_POST['enable']) ? true : false;
|
95 |
|
|
$a_unboundcfg['dnssec'] = ($_POST['dnssec']) ? true : false;
|
96 |
|
|
$a_unboundcfg['forwarding'] = ($_POST['forwarding']) ? true : false;
|
97 |
|
|
$a_unboundcfg['regdhcp'] = ($_POST['regdhcp']) ? true : false;
|
98 |
|
|
$a_unboundcfg['regdhcpstatic'] = ($_POST['regdhcpstatic']) ? true : false;
|
99 |
1b6e3c30
|
Warren Baker
|
$a_unboundcfg['txtsupport'] = ($_POST['txtsupport']) ? true : false;
|
100 |
188609c6
|
Warren Baker
|
if (is_array($_POST['active_interface']) && !empty($_POST['active_interface']))
|
101 |
7ed0e844
|
Warren Baker
|
$a_unboundcfg['active_interface'] = implode(",", $_POST['active_interface']);
|
102 |
188609c6
|
Warren Baker
|
|
103 |
|
|
if (is_array($_POST['outgoing_interface']) && !empty($_POST['outgoing_interface']))
|
104 |
7ed0e844
|
Warren Baker
|
$a_unboundcfg['outgoing_interface'] = implode(",", $_POST['outgoing_interface']);
|
105 |
|
|
|
106 |
|
|
if (!$input_errors) {
|
107 |
|
|
write_config("DNS Resolver configured.");
|
108 |
|
|
$retval = 0;
|
109 |
|
|
$retval = services_unbound_configure();
|
110 |
|
|
$savemsg = get_std_save_message($retval);
|
111 |
80948260
|
Warren Baker
|
if ($retval == 0)
|
112 |
05fec96b
|
Warren Baker
|
clear_subsystem_dirty('unbound');
|
113 |
bd5737dc
|
jim-p
|
/* Update resolv.conf in case the interface bindings exclude localhost. */
|
114 |
|
|
system_resolvconf_generate();
|
115 |
7ed0e844
|
Warren Baker
|
}
|
116 |
|
|
}
|
117 |
|
|
|
118 |
f2bc186f
|
Warren Baker
|
if ($_GET['act'] == "del") {
|
119 |
|
|
if ($_GET['type'] == 'host') {
|
120 |
|
|
if ($a_hosts[$_GET['id']]) {
|
121 |
|
|
unset($a_hosts[$_GET['id']]);
|
122 |
|
|
write_config();
|
123 |
|
|
mark_subsystem_dirty('unbound');
|
124 |
|
|
header("Location: services_unbound.php");
|
125 |
|
|
exit;
|
126 |
|
|
}
|
127 |
|
|
} elseif ($_GET['type'] == 'doverride') {
|
128 |
|
|
if ($a_domainOverrides[$_GET['id']]) {
|
129 |
|
|
unset($a_domainOverrides[$_GET['id']]);
|
130 |
|
|
write_config();
|
131 |
|
|
mark_subsystem_dirty('unbound');
|
132 |
|
|
header("Location: services_unbound.php");
|
133 |
|
|
exit;
|
134 |
|
|
}
|
135 |
|
|
}
|
136 |
|
|
}
|
137 |
|
|
|
138 |
931f47ea
|
Colin Fleming
|
$closehead = false;
|
139 |
7ed0e844
|
Warren Baker
|
$pgtitle = array(gettext("Services"),gettext("DNS Resolver"));
|
140 |
|
|
include_once("head.inc");
|
141 |
|
|
|
142 |
|
|
?>
|
143 |
|
|
|
144 |
fff4a9d1
|
Warren Baker
|
<script type="text/javascript">
|
145 |
931f47ea
|
Colin Fleming
|
//<![CDATA[
|
146 |
7ed0e844
|
Warren Baker
|
function enable_change(enable_over) {
|
147 |
|
|
var endis;
|
148 |
|
|
endis = !(jQuery('#enable').is(":checked") || enable_over);
|
149 |
|
|
jQuery("#active_interface,#outgoing_interface,#dnssec,#forwarding,#regdhcp,#regdhcpstatic,#dhcpfirst,#port").prop('disabled', endis);
|
150 |
|
|
}
|
151 |
|
|
function show_advanced_dns() {
|
152 |
|
|
jQuery("#showadv").show();
|
153 |
|
|
jQuery("#showadvbox").hide();
|
154 |
|
|
}
|
155 |
931f47ea
|
Colin Fleming
|
//]]>
|
156 |
7ed0e844
|
Warren Baker
|
</script>
|
157 |
931f47ea
|
Colin Fleming
|
</head>
|
158 |
7ed0e844
|
Warren Baker
|
|
159 |
|
|
<body>
|
160 |
|
|
<?php include("fbegin.inc"); ?>
|
161 |
|
|
<form action="services_unbound.php" method="post" name="iform" id="iform">
|
162 |
|
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
163 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
164 |
931f47ea
|
Colin Fleming
|
<?php if (is_subsystem_dirty('unbound')): ?><br/>
|
165 |
8cd558b6
|
ayvis
|
<?php print_info_box_np(gettext("The configuration for the DNS Resolver, has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
|
166 |
7ed0e844
|
Warren Baker
|
<?php endif; ?>
|
167 |
13ecf949
|
Warren Baker
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="services unbound">
|
168 |
7ed0e844
|
Warren Baker
|
<tbody>
|
169 |
|
|
<tr>
|
170 |
|
|
<td class="tabnavtbl">
|
171 |
|
|
<?php
|
172 |
|
|
$tab_array = array();
|
173 |
188609c6
|
Warren Baker
|
$tab_array[] = array(gettext("General settings"), true, "services_unbound.php");
|
174 |
|
|
$tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php");
|
175 |
7ed0e844
|
Warren Baker
|
$tab_array[] = array(gettext("Access Lists"), false, "/services_unbound_acls.php");
|
176 |
|
|
display_top_tabs($tab_array, true);
|
177 |
|
|
?>
|
178 |
|
|
</td>
|
179 |
|
|
</tr>
|
180 |
|
|
<tr>
|
181 |
|
|
<td id="mainarea">
|
182 |
|
|
<div class="tabcont">
|
183 |
931f47ea
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
|
184 |
7ed0e844
|
Warren Baker
|
<tbody>
|
185 |
|
|
<tr>
|
186 |
|
|
<td colspan="2" valign="top" class="listtopic"><?=gettext("General DNS Resolver Options");?></td>
|
187 |
|
|
</tr>
|
188 |
|
|
<tr>
|
189 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Enable");?></td>
|
190 |
|
|
<td width="78%" class="vtable"><p>
|
191 |
931f47ea
|
Colin Fleming
|
<input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable'] == "yes") echo "checked=\"checked\"";?> onclick="enable_change(false)" />
|
192 |
8cd558b6
|
ayvis
|
<strong><?=gettext("Enable DNS Resolver");?><br />
|
193 |
931f47ea
|
Colin Fleming
|
</strong></p>
|
194 |
7ed0e844
|
Warren Baker
|
</td>
|
195 |
|
|
</tr>
|
196 |
fff4a9d1
|
Warren Baker
|
<tr>
|
197 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td>
|
198 |
|
|
<td width="78%" class="vtable">
|
199 |
|
|
<p>
|
200 |
931f47ea
|
Colin Fleming
|
<input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"{$pconfig['port']}\"";?> />
|
201 |
fff4a9d1
|
Warren Baker
|
<br /><br />
|
202 |
|
|
<?=gettext("The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.");?>
|
203 |
|
|
</p>
|
204 |
|
|
</td>
|
205 |
|
|
</tr>
|
206 |
7ed0e844
|
Warren Baker
|
<tr>
|
207 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Network Interfaces"); ?></td>
|
208 |
|
|
<td width="78%" class="vtable">
|
209 |
|
|
<?php
|
210 |
|
|
$interface_addresses = get_possible_listen_ips(true);
|
211 |
|
|
$size=count($interface_addresses)+1;
|
212 |
|
|
?>
|
213 |
|
|
<?=gettext("Interface IPs used by the DNS Resolver for responding to queries from clients. If an interface has both IPv4 and IPv6 IPs, both are used. Queries to other interface IPs not selected below are discarded. The default behavior is to respond to queries on every available IPv4 and IPv6 address.");?>
|
214 |
|
|
<br /><br />
|
215 |
93fb6094
|
Colin Fleming
|
<select id="active_interface" name="active_interface[]" multiple="multiple" size="3">
|
216 |
1155de41
|
Warren Baker
|
<option value="" <?php if (empty($pconfig['active_interface']) || empty($pconfig['active_interface'][0])) echo 'selected="selected"'; ?>>All</option>
|
217 |
44cf1382
|
Warren Baker
|
<?php
|
218 |
|
|
foreach ($interface_addresses as $laddr):
|
219 |
7ed0e844
|
Warren Baker
|
$selected = "";
|
220 |
44cf1382
|
Warren Baker
|
if (in_array($laddr['value'], $pconfig['active_interface']))
|
221 |
7ed0e844
|
Warren Baker
|
$selected = 'selected="selected"';
|
222 |
|
|
?>
|
223 |
|
|
<option value="<?=$laddr['value'];?>" <?=$selected;?>>
|
224 |
|
|
<?=htmlspecialchars($laddr['name']);?>
|
225 |
|
|
</option>
|
226 |
|
|
<?php endforeach; ?>
|
227 |
|
|
</select>
|
228 |
|
|
<br /><br />
|
229 |
|
|
</td>
|
230 |
|
|
</tr>
|
231 |
|
|
<tr>
|
232 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Outgoing Network Interfaces"); ?></td>
|
233 |
|
|
<td width="78%" class="vtable">
|
234 |
|
|
<?php
|
235 |
|
|
$interface_addresses = get_possible_listen_ips(true);
|
236 |
|
|
$size=count($interface_addresses)+1;
|
237 |
|
|
?>
|
238 |
|
|
<?=gettext("Utilize different network interface(s) that the DNS Resolver will use to send queries to authoritative servers and receive their replies. By default all interfaces are used.");?>
|
239 |
|
|
<br /><br />
|
240 |
93fb6094
|
Colin Fleming
|
<select id="outgoing_interface" name="outgoing_interface[]" multiple="multiple" size="3">
|
241 |
1155de41
|
Warren Baker
|
<option value="" <?php if (empty($pconfig['outgoing_interface']) || empty($pconfig['outgoing_interface'][0])) echo 'selected="selected"'; ?>>All</option>
|
242 |
44cf1382
|
Warren Baker
|
<?php
|
243 |
|
|
foreach ($interface_addresses as $laddr):
|
244 |
7ed0e844
|
Warren Baker
|
$selected = "";
|
245 |
44cf1382
|
Warren Baker
|
if (in_array($laddr['value'], $pconfig['outgoing_interface']))
|
246 |
7ed0e844
|
Warren Baker
|
$selected = 'selected="selected"';
|
247 |
|
|
?>
|
248 |
|
|
<option value="<?=$laddr['value'];?>" <?=$selected;?>>
|
249 |
|
|
<?=htmlspecialchars($laddr['name']);?>
|
250 |
|
|
</option>
|
251 |
|
|
<?php endforeach; ?>
|
252 |
|
|
</select>
|
253 |
|
|
<br /><br />
|
254 |
|
|
</td>
|
255 |
|
|
</tr>
|
256 |
|
|
<tr>
|
257 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("DNSSEC");?></td>
|
258 |
|
|
<td width="78%" class="vtable"><p>
|
259 |
931f47ea
|
Colin Fleming
|
<input name="dnssec" type="checkbox" id="dnssec" value="yes" <?php echo (isset($pconfig['dnssec']) ? "checked=\"checked\"" : "");?> />
|
260 |
8cd558b6
|
ayvis
|
<strong><?=gettext("Enable DNSSEC Support");?><br />
|
261 |
7ed0e844
|
Warren Baker
|
</strong></p>
|
262 |
|
|
</td>
|
263 |
|
|
</tr>
|
264 |
|
|
<tr>
|
265 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("DNS Query Forwarding");?></td>
|
266 |
|
|
<td width="78%" class="vtable"><p>
|
267 |
931f47ea
|
Colin Fleming
|
<input name="forwarding" type="checkbox" id="forwarding" value="yes" <?php echo (isset($pconfig['forwarding']) ? "checked=\"checked\"" : "");?> />
|
268 |
8cd558b6
|
ayvis
|
<strong><?=gettext("Enable Forwarding Mode");?></strong><br /></p>
|
269 |
7ed0e844
|
Warren Baker
|
</td>
|
270 |
|
|
</tr>
|
271 |
|
|
<tr>
|
272 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCP Registration");?></td>
|
273 |
|
|
<td width="78%" class="vtable"><p>
|
274 |
931f47ea
|
Colin Fleming
|
<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?php if ($pconfig['regdhcp'] === true) echo "checked=\"checked\"";?> />
|
275 |
8cd558b6
|
ayvis
|
<strong><?=gettext("Register DHCP leases in the DNS Resolver");?><br />
|
276 |
7ed0e844
|
Warren Baker
|
</strong><?php printf(gettext("If this option is set, then machines that specify".
|
277 |
|
|
" their hostname when requesting a DHCP lease will be registered".
|
278 |
|
|
" in the DNS Resolver, so that their name can be resolved.".
|
279 |
|
|
" You should also set the domain in %sSystem:".
|
280 |
|
|
" General setup%s to the proper value."),'<a href="system.php">','</a>')?></p>
|
281 |
|
|
</td>
|
282 |
|
|
</tr>
|
283 |
|
|
<tr>
|
284 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Static DHCP");?></td>
|
285 |
|
|
<td width="78%" class="vtable"><p>
|
286 |
931f47ea
|
Colin Fleming
|
<input name="regdhcpstatic" type="checkbox" id="regdhcpstatic" value="yes" <?php if ($pconfig['regdhcpstatic'] === true) echo "checked=\"checked\"";?> />
|
287 |
8cd558b6
|
ayvis
|
<strong><?=gettext("Register DHCP static mappings in the DNS Resolver");?><br />
|
288 |
7ed0e844
|
Warren Baker
|
</strong><?php printf(gettext("If this option is set, then DHCP static mappings will ".
|
289 |
|
|
"be registered in the DNS Resolver, so that their name can be ".
|
290 |
|
|
"resolved. You should also set the domain in %s".
|
291 |
|
|
"System: General setup%s to the proper value."),'<a href="system.php">','</a>');?></p>
|
292 |
|
|
</td>
|
293 |
|
|
</tr>
|
294 |
6b5c8143
|
Warren Baker
|
<tr>
|
295 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("TXT Comment Support");?></td>
|
296 |
|
|
<td width="78%" class="vtable"><p>
|
297 |
931f47ea
|
Colin Fleming
|
<input name="txtsupport" type="checkbox" id="txtsupport" value="yes" <?php echo (isset($pconfig['txtsupport']) ? "checked=\"checked\"" : "");?> />
|
298 |
6b5c8143
|
Warren Baker
|
<strong><?=gettext("If this option is set, then any descriptions associated with Host entries and DHCP Static mappings will create a corresponding TXT record.");?><br />
|
299 |
|
|
</strong></p>
|
300 |
|
|
</td>
|
301 |
|
|
</tr>
|
302 |
7ed0e844
|
Warren Baker
|
<tr>
|
303 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
|
304 |
931f47ea
|
Colin Fleming
|
<td width="78%" class="vtable">
|
305 |
7ed0e844
|
Warren Baker
|
<div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
|
306 |
93fb6094
|
Colin Fleming
|
<input type="button" onclick="show_advanced_dns()" value="<?=gettext("Advanced"); ?>" /> - <?=gettext("Show advanced option");?>
|
307 |
7ed0e844
|
Warren Baker
|
</div>
|
308 |
|
|
<div id="showadv" <?php if (empty($pconfig['custom_options'])) echo "style='display:none'"; ?>>
|
309 |
8cd558b6
|
ayvis
|
<strong><?=gettext("Advanced");?><br /></strong>
|
310 |
|
|
<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=htmlspecialchars($pconfig['custom_options']);?></textarea><br />
|
311 |
|
|
<?=gettext("Enter any additional options you would like to add to the DNS Resolver configuration here, separated by a space or newline"); ?><br />
|
312 |
7ed0e844
|
Warren Baker
|
</div>
|
313 |
|
|
</td>
|
314 |
|
|
</tr>
|
315 |
|
|
<tr>
|
316 |
|
|
<td colspan="2">
|
317 |
931f47ea
|
Colin Fleming
|
<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
|
318 |
7ed0e844
|
Warren Baker
|
</td>
|
319 |
|
|
</tr>
|
320 |
|
|
</tbody>
|
321 |
|
|
</table>
|
322 |
|
|
</div>
|
323 |
|
|
</td>
|
324 |
|
|
</tr>
|
325 |
|
|
</tbody>
|
326 |
|
|
</table>
|
327 |
|
|
|
328 |
|
|
|
329 |
8cd558b6
|
ayvis
|
<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br />
|
330 |
7ed0e844
|
Warren Baker
|
</strong></span><?php printf(gettext("If the DNS Resolver is enabled, the DHCP".
|
331 |
|
|
" service (if enabled) will automatically serve the LAN IP".
|
332 |
|
|
" address as a DNS server to DHCP clients so they will use".
|
333 |
|
|
" the DNS Resolver. If Forwarding, is enabled, the DNS Resolver will use the DNS servers".
|
334 |
|
|
" entered in %sSystem: General setup%s".
|
335 |
|
|
" or those obtained via DHCP or PPP on WAN if the "Allow".
|
336 |
|
|
" DNS server list to be overridden by DHCP/PPP on WAN"".
|
337 |
8cd558b6
|
ayvis
|
" is checked."),'<a href="system.php">','</a>');?><br />
|
338 |
7ed0e844
|
Warren Baker
|
</span></p>
|
339 |
|
|
|
340 |
8cd558b6
|
ayvis
|
<br />
|
341 |
931f47ea
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="host overrides">
|
342 |
7ed0e844
|
Warren Baker
|
<tr>
|
343 |
|
|
<td colspan="5" valign="top" class="listtopic"><?=gettext("Host Overrides");?></td>
|
344 |
|
|
</tr>
|
345 |
|
|
<tr>
|
346 |
8cd558b6
|
ayvis
|
<td><br />
|
347 |
7ed0e844
|
Warren Baker
|
<?=gettext("Entries in this section override individual results from the forwarders.");?>
|
348 |
|
|
<?=gettext("Use these for changing DNS results or for adding custom DNS records.");?>
|
349 |
|
|
</td>
|
350 |
|
|
</tr>
|
351 |
|
|
</table>
|
352 |
931f47ea
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
|
353 |
7ed0e844
|
Warren Baker
|
<thead>
|
354 |
|
|
<tr>
|
355 |
|
|
<td width="20%" class="listhdrr"><?=gettext("Host");?></td>
|
356 |
|
|
<td width="25%" class="listhdrr"><?=gettext("Domain");?></td>
|
357 |
|
|
<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
|
358 |
|
|
<td width="25%" class="listhdr"><?=gettext("Description");?></td>
|
359 |
|
|
<td width="10%" class="list">
|
360 |
931f47ea
|
Colin Fleming
|
<table border="0" cellspacing="0" cellpadding="1" summary="add">
|
361 |
7ed0e844
|
Warren Baker
|
<tr>
|
362 |
|
|
<td width="17"></td>
|
363 |
931f47ea
|
Colin Fleming
|
<td valign="middle"><a href="services_unbound_host_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
|
364 |
7ed0e844
|
Warren Baker
|
</tr>
|
365 |
|
|
</table>
|
366 |
|
|
</td>
|
367 |
|
|
</tr>
|
368 |
|
|
</thead>
|
369 |
931f47ea
|
Colin Fleming
|
<tfoot>
|
370 |
|
|
<tr>
|
371 |
|
|
<td class="list" colspan="4"></td>
|
372 |
|
|
<td class="list">
|
373 |
|
|
<table border="0" cellspacing="0" cellpadding="1" summary="add">
|
374 |
|
|
<tr>
|
375 |
|
|
<td width="17"></td>
|
376 |
|
|
<td valign="middle"><a href="services_unbound_host_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
|
377 |
|
|
</tr>
|
378 |
|
|
</table>
|
379 |
|
|
</td>
|
380 |
|
|
</tr>
|
381 |
|
|
</tfoot>
|
382 |
7ed0e844
|
Warren Baker
|
<tbody>
|
383 |
|
|
<?php $i = 0; foreach ($a_hosts as $hostent): ?>
|
384 |
|
|
<tr>
|
385 |
80948260
|
Warren Baker
|
<td class="listlr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
|
386 |
7ed0e844
|
Warren Baker
|
<?=strtolower($hostent['host']);?>
|
387 |
|
|
</td>
|
388 |
80948260
|
Warren Baker
|
<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
|
389 |
7ed0e844
|
Warren Baker
|
<?=strtolower($hostent['domain']);?>
|
390 |
|
|
</td>
|
391 |
80948260
|
Warren Baker
|
<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
|
392 |
7ed0e844
|
Warren Baker
|
<?=$hostent['ip'];?>
|
393 |
|
|
</td>
|
394 |
80948260
|
Warren Baker
|
<td class="listbg" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
|
395 |
7ed0e844
|
Warren Baker
|
<?=htmlspecialchars($hostent['descr']);?>
|
396 |
|
|
</td>
|
397 |
931f47ea
|
Colin Fleming
|
<td valign="middle" class="list nowrap">
|
398 |
|
|
<table border="0" cellspacing="0" cellpadding="1" summary="icons">
|
399 |
7ed0e844
|
Warren Baker
|
<tr>
|
400 |
931f47ea
|
Colin Fleming
|
<td valign="middle"><a href="services_unbound_host_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td>
|
401 |
|
|
<td><a href="services_unbound.php?type=host&act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this host?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
|
402 |
7ed0e844
|
Warren Baker
|
</tr>
|
403 |
|
|
</table>
|
404 |
|
|
</tr>
|
405 |
|
|
<?php $i++; endforeach; ?>
|
406 |
931f47ea
|
Colin Fleming
|
<tr style="display:none"><td></td></tr>
|
407 |
7ed0e844
|
Warren Baker
|
</tbody>
|
408 |
|
|
</table>
|
409 |
8cd558b6
|
ayvis
|
<br />
|
410 |
931f47ea
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="domain overrides">
|
411 |
7ed0e844
|
Warren Baker
|
<tr>
|
412 |
|
|
<td colspan="5" valign="top" class="listtopic"><?=gettext("Domain Overrides");?></td>
|
413 |
|
|
</tr>
|
414 |
|
|
<tr>
|
415 |
931f47ea
|
Colin Fleming
|
<td><p><?=gettext("Entries in this area override an entire domain by specifying an".
|
416 |
|
|
" authoritative DNS server to be queried for that domain.");?></p></td>
|
417 |
7ed0e844
|
Warren Baker
|
</tr>
|
418 |
|
|
</table>
|
419 |
931f47ea
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
|
420 |
7ed0e844
|
Warren Baker
|
<thead>
|
421 |
|
|
<tr>
|
422 |
|
|
<td width="35%" class="listhdrr"><?=gettext("Domain");?></td>
|
423 |
|
|
<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
|
424 |
|
|
<td width="35%" class="listhdr"><?=gettext("Description");?></td>
|
425 |
|
|
<td width="10%" class="list">
|
426 |
931f47ea
|
Colin Fleming
|
<table border="0" cellspacing="0" cellpadding="1" summary="add">
|
427 |
7ed0e844
|
Warren Baker
|
<tr>
|
428 |
931f47ea
|
Colin Fleming
|
<td width="17" height="17"></td>
|
429 |
|
|
<td><a href="services_unbound_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
|
430 |
7ed0e844
|
Warren Baker
|
</tr>
|
431 |
|
|
</table>
|
432 |
|
|
</td>
|
433 |
|
|
</tr>
|
434 |
|
|
</thead>
|
435 |
931f47ea
|
Colin Fleming
|
<tfoot>
|
436 |
|
|
<tr>
|
437 |
|
|
<td class="list" colspan="3"></td>
|
438 |
|
|
<td class="list">
|
439 |
|
|
<table border="0" cellspacing="0" cellpadding="1" summary="add">
|
440 |
|
|
<tr>
|
441 |
|
|
<td width="17" height="17"></td>
|
442 |
|
|
<td><a href="services_unbound_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
|
443 |
|
|
</tr>
|
444 |
|
|
</table>
|
445 |
|
|
</td>
|
446 |
|
|
</tr>
|
447 |
|
|
</tfoot>
|
448 |
7ed0e844
|
Warren Baker
|
<tbody>
|
449 |
|
|
<?php $i = 0; foreach ($a_domainOverrides as $doment): ?>
|
450 |
|
|
<tr>
|
451 |
|
|
<td class="listlr">
|
452 |
|
|
<?=strtolower($doment['domain']);?>
|
453 |
|
|
</td>
|
454 |
|
|
<td class="listr">
|
455 |
|
|
<?=$doment['ip'];?>
|
456 |
|
|
</td>
|
457 |
|
|
<td class="listbg">
|
458 |
|
|
<?=htmlspecialchars($doment['descr']);?>
|
459 |
|
|
</td>
|
460 |
931f47ea
|
Colin Fleming
|
<td valign="middle" class="list nowrap"> <a href="services_unbound_domainoverride_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a>
|
461 |
|
|
<a href="services_unbound.php?act=del&type=doverride&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this domain override?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
|
462 |
7ed0e844
|
Warren Baker
|
</tr>
|
463 |
|
|
<?php $i++; endforeach; ?>
|
464 |
931f47ea
|
Colin Fleming
|
<tr style="display:none"><td></td></tr>
|
465 |
7ed0e844
|
Warren Baker
|
</tbody>
|
466 |
|
|
</table>
|
467 |
|
|
</form>
|
468 |
fff4a9d1
|
Warren Baker
|
<script type="text/javascript">
|
469 |
931f47ea
|
Colin Fleming
|
//<![CDATA[
|
470 |
7ed0e844
|
Warren Baker
|
enable_change(false);
|
471 |
931f47ea
|
Colin Fleming
|
//]]>
|
472 |
7ed0e844
|
Warren Baker
|
</script>
|
473 |
|
|
<?php include("fend.inc"); ?>
|
474 |
|
|
</body>
|
475 |
|
|
</html>
|