1 |
5b237745
|
Scott Ullrich
|
<?php
|
2 |
b46bfcf5
|
Bill Marquette
|
/* $Id$ */
|
3 |
5b237745
|
Scott Ullrich
|
/*
|
4 |
|
|
services_dnsmasq.php
|
5 |
|
|
part of m0n0wall (http://m0n0.ch/wall)
|
6 |
f0fe3d30
|
Scott Ullrich
|
|
7 |
5b237745
|
Scott Ullrich
|
Copyright (C) 2003-2004 Bob Zoller <bob@kludgebox.com> and Manuel Kasper <mk@neon1.net>.
|
8 |
|
|
All rights reserved.
|
9 |
f0fe3d30
|
Scott Ullrich
|
|
10 |
5b237745
|
Scott Ullrich
|
Redistribution and use in source and binary forms, with or without
|
11 |
|
|
modification, are permitted provided that the following conditions are met:
|
12 |
f0fe3d30
|
Scott Ullrich
|
|
13 |
5b237745
|
Scott Ullrich
|
1. Redistributions of source code must retain the above copyright notice,
|
14 |
|
|
this list of conditions and the following disclaimer.
|
15 |
f0fe3d30
|
Scott Ullrich
|
|
16 |
5b237745
|
Scott Ullrich
|
2. Redistributions in binary form must reproduce the above copyright
|
17 |
|
|
notice, this list of conditions and the following disclaimer in the
|
18 |
|
|
documentation and/or other materials provided with the distribution.
|
19 |
f0fe3d30
|
Scott Ullrich
|
|
20 |
5b237745
|
Scott Ullrich
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
21 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
22 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
23 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
24 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
30 |
|
|
*/
|
31 |
70edf50d
|
jim-p
|
/*
|
32 |
1d333258
|
Scott Ullrich
|
pfSense_MODULE: dnsforwarder
|
33 |
|
|
*/
|
34 |
5b237745
|
Scott Ullrich
|
|
35 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
36 |
|
|
##|*IDENT=page-services-dnsforwarder
|
37 |
|
|
##|*NAME=Services: DNS Forwarder page
|
38 |
|
|
##|*DESCR=Allow access to the 'Services: DNS Forwarder' page.
|
39 |
|
|
##|*MATCH=services_dnsmasq.php*
|
40 |
|
|
##|-PRIV
|
41 |
|
|
|
42 |
5b237745
|
Scott Ullrich
|
require("guiconfig.inc");
|
43 |
7a927e67
|
Scott Ullrich
|
require_once("functions.inc");
|
44 |
|
|
require_once("filter.inc");
|
45 |
|
|
require_once("shaper.inc");
|
46 |
5b237745
|
Scott Ullrich
|
|
47 |
70edf50d
|
jim-p
|
$pconfig['enable'] = isset($config['dnsmasq']['enable']);
|
48 |
5b237745
|
Scott Ullrich
|
$pconfig['regdhcp'] = isset($config['dnsmasq']['regdhcp']);
|
49 |
6a01ea44
|
Bill Marquette
|
$pconfig['regdhcpstatic'] = isset($config['dnsmasq']['regdhcpstatic']);
|
50 |
aa994814
|
Andrew Thompson
|
$pconfig['dhcpfirst'] = isset($config['dnsmasq']['dhcpfirst']);
|
51 |
96ea7162
|
N0YB
|
$pconfig['strict_order'] = isset($config['dnsmasq']['strict_order']);
|
52 |
|
|
$pconfig['domain_needed'] = isset($config['dnsmasq']['domain_needed']);
|
53 |
7bdd28fb
|
Phil Davis
|
$pconfig['no_private_reverse'] = isset($config['dnsmasq']['no_private_reverse']);
|
54 |
e6c49e3d
|
jim-p
|
$pconfig['port'] = $config['dnsmasq']['port'];
|
55 |
8f9bffbc
|
Andrew Thompson
|
$pconfig['custom_options'] = $config['dnsmasq']['custom_options'];
|
56 |
5b237745
|
Scott Ullrich
|
|
57 |
b4323f39
|
jim-p
|
$pconfig['strictbind'] = isset($config['dnsmasq']['strictbind']);
|
58 |
79d03c40
|
jim-p
|
if (!empty($config['dnsmasq']['interface']))
|
59 |
|
|
$pconfig['interface'] = explode(",", $config['dnsmasq']['interface']);
|
60 |
|
|
else
|
61 |
|
|
$pconfig['interface'] = array();
|
62 |
b4323f39
|
jim-p
|
|
63 |
70edf50d
|
jim-p
|
if (!is_array($config['dnsmasq']['hosts']))
|
64 |
5b237745
|
Scott Ullrich
|
$config['dnsmasq']['hosts'] = array();
|
65 |
0c2b5df7
|
Scott Ullrich
|
|
66 |
70edf50d
|
jim-p
|
if (!is_array($config['dnsmasq']['domainoverrides']))
|
67 |
|
|
$config['dnsmasq']['domainoverrides'] = array();
|
68 |
0c2b5df7
|
Scott Ullrich
|
|
69 |
4d6ba181
|
Scott Ullrich
|
|
70 |
70edf50d
|
jim-p
|
$a_hosts = &$config['dnsmasq']['hosts'];
|
71 |
0c2b5df7
|
Scott Ullrich
|
$a_domainOverrides = &$config['dnsmasq']['domainoverrides'];
|
72 |
5b237745
|
Scott Ullrich
|
|
73 |
|
|
if ($_POST) {
|
74 |
|
|
|
75 |
|
|
$pconfig = $_POST;
|
76 |
8f9bffbc
|
Andrew Thompson
|
unset($input_errors);
|
77 |
5b237745
|
Scott Ullrich
|
|
78 |
|
|
$config['dnsmasq']['enable'] = ($_POST['enable']) ? true : false;
|
79 |
|
|
$config['dnsmasq']['regdhcp'] = ($_POST['regdhcp']) ? true : false;
|
80 |
6a01ea44
|
Bill Marquette
|
$config['dnsmasq']['regdhcpstatic'] = ($_POST['regdhcpstatic']) ? true : false;
|
81 |
aa994814
|
Andrew Thompson
|
$config['dnsmasq']['dhcpfirst'] = ($_POST['dhcpfirst']) ? true : false;
|
82 |
96ea7162
|
N0YB
|
$config['dnsmasq']['strict_order'] = ($_POST['strict_order']) ? true : false;
|
83 |
|
|
$config['dnsmasq']['domain_needed'] = ($_POST['domain_needed']) ? true : false;
|
84 |
7bdd28fb
|
Phil Davis
|
$config['dnsmasq']['no_private_reverse'] = ($_POST['no_private_reverse']) ? true : false;
|
85 |
8f9bffbc
|
Andrew Thompson
|
$config['dnsmasq']['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
|
86 |
b4323f39
|
jim-p
|
$config['dnsmasq']['strictbind'] = ($_POST['strictbind']) ? true : false;
|
87 |
8f9bffbc
|
Andrew Thompson
|
|
88 |
e6c49e3d
|
jim-p
|
if ($_POST['port'])
|
89 |
|
|
if(is_port($_POST['port']))
|
90 |
|
|
$config['dnsmasq']['port'] = $_POST['port'];
|
91 |
|
|
else
|
92 |
|
|
$input_errors[] = gettext("You must specify a valid port number");
|
93 |
|
|
else if (isset($config['dnsmasq']['port']))
|
94 |
|
|
unset($config['dnsmasq']['port']);
|
95 |
|
|
|
96 |
b4323f39
|
jim-p
|
if (is_array($_POST['interface']))
|
97 |
|
|
$config['dnsmasq']['interface'] = implode(",", $_POST['interface']);
|
98 |
|
|
elseif (isset($config['dnsmasq']['interface']))
|
99 |
|
|
unset($config['dnsmasq']['interface']);
|
100 |
e6c49e3d
|
jim-p
|
|
101 |
8f9bffbc
|
Andrew Thompson
|
if ($config['dnsmasq']['custom_options']) {
|
102 |
|
|
$args = '';
|
103 |
|
|
foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c)
|
104 |
|
|
$args .= "--$c ";
|
105 |
|
|
exec("/usr/local/sbin/dnsmasq --test $args", $output, $rc);
|
106 |
|
|
if ($rc != 0)
|
107 |
|
|
$input_errors[] = gettext("Invalid custom options");
|
108 |
|
|
}
|
109 |
5b237745
|
Scott Ullrich
|
|
110 |
8f9bffbc
|
Andrew Thompson
|
if (!$input_errors) {
|
111 |
|
|
write_config();
|
112 |
f0fe3d30
|
Scott Ullrich
|
|
113 |
8f9bffbc
|
Andrew Thompson
|
$retval = 0;
|
114 |
|
|
$retval = services_dnsmasq_configure();
|
115 |
|
|
$savemsg = get_std_save_message($retval);
|
116 |
5b237745
|
Scott Ullrich
|
|
117 |
8f9bffbc
|
Andrew Thompson
|
// Relaod filter (we might need to sync to CARP hosts)
|
118 |
|
|
filter_configure();
|
119 |
020d757a
|
Scott Ullrich
|
|
120 |
8f9bffbc
|
Andrew Thompson
|
if ($retval == 0)
|
121 |
|
|
clear_subsystem_dirty('hosts');
|
122 |
|
|
}
|
123 |
5b237745
|
Scott Ullrich
|
}
|
124 |
|
|
|
125 |
|
|
if ($_GET['act'] == "del") {
|
126 |
70edf50d
|
jim-p
|
if ($_GET['type'] == 'host') {
|
127 |
|
|
if ($a_hosts[$_GET['id']]) {
|
128 |
|
|
unset($a_hosts[$_GET['id']]);
|
129 |
|
|
write_config();
|
130 |
a368a026
|
Ermal Lu?i
|
mark_subsystem_dirty('hosts');
|
131 |
70edf50d
|
jim-p
|
header("Location: services_dnsmasq.php");
|
132 |
|
|
exit;
|
133 |
|
|
}
|
134 |
|
|
}
|
135 |
|
|
elseif ($_GET['type'] == 'doverride') {
|
136 |
|
|
if ($a_domainOverrides[$_GET['id']]) {
|
137 |
|
|
unset($a_domainOverrides[$_GET['id']]);
|
138 |
|
|
write_config();
|
139 |
a368a026
|
Ermal Lu?i
|
mark_subsystem_dirty('hosts');
|
140 |
70edf50d
|
jim-p
|
header("Location: services_dnsmasq.php");
|
141 |
|
|
exit;
|
142 |
|
|
}
|
143 |
|
|
}
|
144 |
5b237745
|
Scott Ullrich
|
}
|
145 |
0c2b5df7
|
Scott Ullrich
|
|
146 |
beb2bc00
|
Rafael Lucas
|
$pgtitle = array(gettext("Services"),gettext("DNS forwarder"));
|
147 |
b32dd0a6
|
jim-p
|
$shortcut_section = "resolver";
|
148 |
b63695db
|
Scott Ullrich
|
include("head.inc");
|
149 |
0c2b5df7
|
Scott Ullrich
|
|
150 |
5b237745
|
Scott Ullrich
|
?>
|
151 |
|
|
|
152 |
6a01ea44
|
Bill Marquette
|
<script language="JavaScript">
|
153 |
|
|
<!--
|
154 |
|
|
function enable_change(enable_over) {
|
155 |
|
|
var endis;
|
156 |
|
|
endis = !(document.iform.enable.checked || enable_over);
|
157 |
|
|
document.iform.regdhcp.disabled = endis;
|
158 |
|
|
document.iform.regdhcpstatic.disabled = endis;
|
159 |
aa994814
|
Andrew Thompson
|
document.iform.dhcpfirst.disabled = endis;
|
160 |
6a01ea44
|
Bill Marquette
|
}
|
161 |
8f9bffbc
|
Andrew Thompson
|
function show_advanced_dns() {
|
162 |
|
|
document.getElementById("showadvbox").innerHTML='';
|
163 |
|
|
aodiv = document.getElementById('showadv');
|
164 |
|
|
aodiv.style.display = "block";
|
165 |
|
|
}
|
166 |
6a01ea44
|
Bill Marquette
|
//-->
|
167 |
|
|
</script>
|
168 |
|
|
|
169 |
5b237745
|
Scott Ullrich
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
170 |
|
|
<?php include("fbegin.inc"); ?>
|
171 |
6a01ea44
|
Bill Marquette
|
<form action="services_dnsmasq.php" method="post" name="iform" id="iform">
|
172 |
8f9bffbc
|
Andrew Thompson
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
173 |
5b237745
|
Scott Ullrich
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
174 |
a368a026
|
Ermal Lu?i
|
<?php if (is_subsystem_dirty('hosts')): ?><p>
|
175 |
619c72f9
|
Carlos Eduardo Ramos
|
<?php print_info_box_np(gettext("The DNS forwarder configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect."));?><br>
|
176 |
5b237745
|
Scott Ullrich
|
<?php endif; ?>
|
177 |
70edf50d
|
jim-p
|
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
178 |
|
|
<tr>
|
179 |
6661dbcf
|
jim-p
|
<td colspan="2" valign="top" class="listtopic"><?=gettext("General DNS Forwarder Options");?></td>
|
180 |
|
|
</tr>
|
181 |
|
|
<tr>
|
182 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Enable");?></td>
|
183 |
|
|
<td width="78%" class="vtable"><p>
|
184 |
70edf50d
|
jim-p
|
<input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable'] == "yes") echo "checked";?> onClick="enable_change(false)">
|
185 |
|
|
<strong><?=gettext("Enable DNS forwarder");?><br>
|
186 |
|
|
</strong></p></td>
|
187 |
98776e04
|
jim-p
|
</tr>
|
188 |
70edf50d
|
jim-p
|
<tr>
|
189 |
6661dbcf
|
jim-p
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCP Registration");?></td>
|
190 |
|
|
<td width="78%" class="vtable"><p>
|
191 |
70edf50d
|
jim-p
|
<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?php if ($pconfig['regdhcp'] == "yes") echo "checked";?>>
|
192 |
|
|
<strong><?=gettext("Register DHCP leases in DNS forwarder");?><br>
|
193 |
|
|
</strong><?php printf(gettext("If this option is set, then machines that specify".
|
194 |
|
|
" their hostname when requesting a DHCP lease will be registered".
|
195 |
|
|
" in the DNS forwarder, so that their name can be resolved.".
|
196 |
|
|
" You should also set the domain in %sSystem:".
|
197 |
|
|
" General setup%s to the proper value."),'<a href="system.php">','</a>')?></p>
|
198 |
|
|
</td>
|
199 |
|
|
</tr>
|
200 |
|
|
<tr>
|
201 |
6661dbcf
|
jim-p
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Static DHCP");?></td>
|
202 |
|
|
<td width="78%" class="vtable"><p>
|
203 |
70edf50d
|
jim-p
|
<input name="regdhcpstatic" type="checkbox" id="regdhcpstatic" value="yes" <?php if ($pconfig['regdhcpstatic'] == "yes") echo "checked";?>>
|
204 |
|
|
<strong><?=gettext("Register DHCP static mappings in DNS forwarder");?><br>
|
205 |
|
|
</strong><?php printf(gettext("If this option is set, then DHCP static mappings will ".
|
206 |
|
|
"be registered in the DNS forwarder, so that their name can be ".
|
207 |
|
|
"resolved. You should also set the domain in %s".
|
208 |
|
|
"System: General setup%s to the proper value."),'<a href="system.php">','</a>');?></p>
|
209 |
|
|
</td>
|
210 |
|
|
</tr>
|
211 |
aa994814
|
Andrew Thompson
|
<tr>
|
212 |
6661dbcf
|
jim-p
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Prefer DHCP");?></td>
|
213 |
|
|
<td width="78%" class="vtable"><p>
|
214 |
aa994814
|
Andrew Thompson
|
<input name="dhcpfirst" type="checkbox" id="dhcpfirst" value="yes" <?php if ($pconfig['dhcpfirst'] == "yes") echo "checked";?>>
|
215 |
|
|
<strong><?=gettext("Resolve DHCP mappings first");?><br>
|
216 |
|
|
</strong><?php printf(gettext("If this option is set, then DHCP mappings will ".
|
217 |
|
|
"be resolved before the manual list of names below. This only ".
|
218 |
649ea752
|
Andrew Thompson
|
"affects the name given for a reverse lookup (PTR)."));?></p>
|
219 |
aa994814
|
Andrew Thompson
|
</td>
|
220 |
|
|
</tr>
|
221 |
96ea7162
|
N0YB
|
<tr>
|
222 |
7bdd28fb
|
Phil Davis
|
<td rowspan="3" width="22%" valign="top" class="vncellreq"><?=gettext("DNS Query Forwarding");?></td>
|
223 |
96ea7162
|
N0YB
|
<td width="78%" class="vtable"><p>
|
224 |
|
|
<input name="strict_order" type="checkbox" id="strict_order" value="yes" <?php if ($pconfig['strict_order'] == "yes") echo "checked";?>>
|
225 |
|
|
<strong><?=gettext("Query DNS servers sequentially");?><br>
|
226 |
|
|
</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
|
227 |
|
|
"query the DNS servers sequentially in the order specified (<i>System - General Setup - DNS Servers</i>), ".
|
228 |
|
|
"rather than all at once in parallel. ".
|
229 |
|
|
""), $g['product_name']); ?></p>
|
230 |
|
|
</td>
|
231 |
|
|
</tr>
|
232 |
|
|
<tr>
|
233 |
|
|
<td width="78%" class="vtable"><p>
|
234 |
|
|
<input name="domain_needed" type="checkbox" id="domain_needed" value="yes" <?php if ($pconfig['domain_needed'] == "yes") echo "checked";?>>
|
235 |
|
|
<strong><?=gettext("Require domain");?><br>
|
236 |
|
|
</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
|
237 |
|
|
"not forward A or AAAA queries for plain names, without dots or domain parts, to upstream name servers. ".
|
238 |
|
|
"If the name is not known from /etc/hosts or DHCP then a \"not found\" answer is returned. ".
|
239 |
|
|
""), $g['product_name']); ?></p>
|
240 |
|
|
</td>
|
241 |
|
|
</tr>
|
242 |
7bdd28fb
|
Phil Davis
|
<tr>
|
243 |
|
|
<td width="78%" class="vtable"><p>
|
244 |
|
|
<input name="no_private_reverse" type="checkbox" id="no_private_reverse" value="yes" <?php if ($pconfig['no_private_reverse'] == "yes") echo "checked";?>>
|
245 |
|
|
<strong><?=gettext("Do not forward private reverse lookups");?><br>
|
246 |
|
|
</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
|
247 |
|
|
"not forward reverse DNS lookups (PTR) for private addresses (RFC 1918) to upstream name servers. ".
|
248 |
|
|
"Any entries in the Domain Overrides section forwarding private \"n.n.n.in-addr.arpa\" names to a specific server are still forwarded. ".
|
249 |
|
|
"If the IP to name is not known from /etc/hosts, DHCP or a specific domain override then a \"not found\" answer is immediately returned. ".
|
250 |
|
|
""), $g['product_name']); ?></p>
|
251 |
|
|
</td>
|
252 |
|
|
</tr>
|
253 |
e6c49e3d
|
jim-p
|
<tr>
|
254 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td>
|
255 |
|
|
<td width="78%" class="vtable"><p>
|
256 |
|
|
<input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"{$pconfig['port']}\"";?>>
|
257 |
|
|
<br /><br />
|
258 |
|
|
<?=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.");?></p>
|
259 |
|
|
</td>
|
260 |
|
|
</tr>
|
261 |
b4323f39
|
jim-p
|
<tr>
|
262 |
|
|
<td width="22%" valign="top" rowspan="2" class="vncellreq"><?=gettext("Interfaces"); ?></td>
|
263 |
|
|
<td width="78%" class="vtable">
|
264 |
|
|
<?php
|
265 |
|
|
$interface_addresses = get_possible_listen_ips(true);
|
266 |
|
|
$size=count($interface_addresses)+1;
|
267 |
|
|
?>
|
268 |
79d03c40
|
jim-p
|
<?=gettext("Interface IPs used by the DNS Forwarder 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.");?>
|
269 |
b4323f39
|
jim-p
|
<br /><br />
|
270 |
|
|
<select id="interface" name="interface[]" multiple="true" class="formselect" size="<?php echo $size; ?>">
|
271 |
79d03c40
|
jim-p
|
<option value="" <?php if (empty($pconfig['interface'])) echo 'selected="selected"'; ?>>All</option>
|
272 |
b4323f39
|
jim-p
|
<?php foreach ($interface_addresses as $laddr):
|
273 |
|
|
$selected = "";
|
274 |
|
|
if (in_array($laddr['value'], $pconfig['interface']))
|
275 |
|
|
$selected = 'selected="selected"';
|
276 |
|
|
?>
|
277 |
|
|
<option value="<?=$laddr['value'];?>" <?=$selected;?>>
|
278 |
|
|
<?=htmlspecialchars($laddr['name']);?>
|
279 |
|
|
</option>
|
280 |
|
|
<?php endforeach; ?>
|
281 |
|
|
</select>
|
282 |
79d03c40
|
jim-p
|
<br /><br />
|
283 |
b4323f39
|
jim-p
|
</td>
|
284 |
|
|
</tr>
|
285 |
|
|
<tr>
|
286 |
|
|
<td width="78%" class="vtable"><p>
|
287 |
|
|
<input name="strictbind" type="checkbox" id="strictbind" value="yes" <?php if ($pconfig['strictbind'] == "yes") echo "checked";?>>
|
288 |
|
|
<strong><?=gettext("Strict Interface Binding");?></strong>
|
289 |
|
|
<br />
|
290 |
79d03c40
|
jim-p
|
<?= gettext("If this option is set, the DNS forwarder will only bind to the interfaces containing the IP addresses selected above, rather than binding to all interfaces and discarding queries to other addresses."); ?>
|
291 |
b4323f39
|
jim-p
|
<br /><br />
|
292 |
|
|
<?= gettext("NOTE: This option does NOT work with IPv6. If set, dnsmasq will not bind to IPv6 addresses."); ?>
|
293 |
|
|
</p>
|
294 |
|
|
</td>
|
295 |
|
|
</tr>
|
296 |
8f9bffbc
|
Andrew Thompson
|
<tr>
|
297 |
6661dbcf
|
jim-p
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
|
298 |
|
|
<td width="78%" class="vtable"><p>
|
299 |
8f9bffbc
|
Andrew Thompson
|
<div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
|
300 |
|
|
<input type="button" onClick="show_advanced_dns()" value="<?=gettext("Advanced"); ?>"></input> - <?=gettext("Show advanced option");?></a>
|
301 |
|
|
</div>
|
302 |
|
|
<div id="showadv" <?php if (empty($pconfig['custom_options'])) echo "style='display:none'"; ?>>
|
303 |
|
|
<strong><?=gettext("Advanced");?><br></strong>
|
304 |
|
|
<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=htmlspecialchars($pconfig['custom_options']);?></textarea><br/>
|
305 |
|
|
<?=gettext("Enter any additional options you would like to add to the dnsmasq configuration here, separated by a space or newline"); ?><br/>
|
306 |
|
|
</div>
|
307 |
|
|
</p>
|
308 |
|
|
</td>
|
309 |
|
|
</tr>
|
310 |
70edf50d
|
jim-p
|
<tr>
|
311 |
6661dbcf
|
jim-p
|
<td colspan="2">
|
312 |
70edf50d
|
jim-p
|
<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)">
|
313 |
|
|
</td>
|
314 |
|
|
</tr>
|
315 |
|
|
</table>
|
316 |
6661dbcf
|
jim-p
|
|
317 |
|
|
<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br>
|
318 |
|
|
</strong></span><?php printf(gettext("If the DNS forwarder is enabled, the DHCP".
|
319 |
|
|
" service (if enabled) will automatically serve the LAN IP".
|
320 |
|
|
" address as a DNS server to DHCP clients so they will use".
|
321 |
|
|
" the forwarder. The DNS forwarder will use the DNS servers".
|
322 |
|
|
" entered in %sSystem: General setup%s".
|
323 |
|
|
" or those obtained via DHCP or PPP on WAN if the "Allow".
|
324 |
|
|
" DNS server list to be overridden by DHCP/PPP on WAN"".
|
325 |
|
|
" is checked. If you don't use that option (or if you use".
|
326 |
|
|
" a static IP address on WAN), you must manually specify at".
|
327 |
|
|
" least one DNS server on the %sSystem:".
|
328 |
|
|
"General setup%s page."),'<a href="system.php">','</a>','<a href="system.php">','</a>');?><br>
|
329 |
|
|
</span></p>
|
330 |
|
|
|
331 |
70edf50d
|
jim-p
|
<br>
|
332 |
6661dbcf
|
jim-p
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont">
|
333 |
|
|
<tr>
|
334 |
|
|
<td colspan="5" valign="top" class="listtopic"><?=gettext("Host Overrides");?></td>
|
335 |
|
|
</tr>
|
336 |
|
|
<tr>
|
337 |
|
|
<td><br/>
|
338 |
|
|
<?=gettext("Entries in this section override individual results from the forwarders.");?>
|
339 |
|
|
<?=gettext("Use these for changing DNS results or for adding custom DNS records.");?>
|
340 |
|
|
</td>
|
341 |
|
|
</tr>
|
342 |
|
|
</table>
|
343 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable">
|
344 |
70edf50d
|
jim-p
|
<thead>
|
345 |
|
|
<tr>
|
346 |
|
|
<td width="20%" class="listhdrr"><?=gettext("Host");?></td>
|
347 |
|
|
<td width="25%" class="listhdrr"><?=gettext("Domain");?></td>
|
348 |
|
|
<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
|
349 |
|
|
<td width="25%" class="listhdr"><?=gettext("Description");?></td>
|
350 |
|
|
<td width="10%" class="list">
|
351 |
d415d821
|
Seth Mos
|
<table border="0" cellspacing="0" cellpadding="1">
|
352 |
70edf50d
|
jim-p
|
<tr>
|
353 |
|
|
<td width="17"></td>
|
354 |
|
|
<td valign="middle"><a href="services_dnsmasq_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
|
355 |
|
|
</tr>
|
356 |
d415d821
|
Seth Mos
|
</table>
|
357 |
70edf50d
|
jim-p
|
</td>
|
358 |
|
|
</tr>
|
359 |
|
|
</thead>
|
360 |
|
|
<tbody>
|
361 |
|
|
<?php $i = 0; foreach ($a_hosts as $hostent): ?>
|
362 |
|
|
<tr>
|
363 |
|
|
<td class="listlr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
|
364 |
|
|
<?=strtolower($hostent['host']);?>
|
365 |
|
|
</td>
|
366 |
|
|
<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
|
367 |
|
|
<?=strtolower($hostent['domain']);?>
|
368 |
|
|
</td>
|
369 |
|
|
<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
|
370 |
|
|
<?=$hostent['ip'];?>
|
371 |
|
|
</td>
|
372 |
|
|
<td class="listbg" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
|
373 |
|
|
<?=htmlspecialchars($hostent['descr']);?>
|
374 |
|
|
</td>
|
375 |
|
|
<td valign="middle" nowrap class="list">
|
376 |
d415d821
|
Seth Mos
|
<table border="0" cellspacing="0" cellpadding="1">
|
377 |
70edf50d
|
jim-p
|
<tr>
|
378 |
|
|
<td valign="middle"><a href="services_dnsmasq_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
|
379 |
|
|
<td><a href="services_dnsmasq.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"></a></td>
|
380 |
|
|
</tr>
|
381 |
d415d821
|
Seth Mos
|
</table>
|
382 |
70edf50d
|
jim-p
|
</tr>
|
383 |
e37eeb49
|
jim-p
|
<?php if ($hostent['aliases']['item'] && is_array($hostent['aliases']['item'])): ?>
|
384 |
5a2a8349
|
Lorenz Schori
|
<?php foreach ($hostent['aliases']['item'] as $alias): ?>
|
385 |
|
|
<tr>
|
386 |
|
|
<td class="listlr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
|
387 |
|
|
<?=strtolower($alias['host']);?>
|
388 |
|
|
</td>
|
389 |
|
|
<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
|
390 |
|
|
<?=strtolower($alias['domain']);?>
|
391 |
|
|
</td>
|
392 |
|
|
<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
|
393 |
|
|
Alias for <?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain'];?>
|
394 |
|
|
</td>
|
395 |
|
|
<td class="listbg" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
|
396 |
|
|
<?=htmlspecialchars($alias['description']);?>
|
397 |
|
|
</td>
|
398 |
|
|
<td valign="middle" nowrap class="list">
|
399 |
|
|
<a href="services_dnsmasq_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a>
|
400 |
|
|
</td>
|
401 |
|
|
</tr>
|
402 |
|
|
<?php endforeach; ?>
|
403 |
e37eeb49
|
jim-p
|
<?php endif; ?>
|
404 |
70edf50d
|
jim-p
|
<?php $i++; endforeach; ?>
|
405 |
|
|
</tbody>
|
406 |
|
|
<tfoot>
|
407 |
|
|
<tr>
|
408 |
|
|
<td class="list" colspan="4"></td>
|
409 |
|
|
<td class="list">
|
410 |
|
|
<table border="0" cellspacing="0" cellpadding="1">
|
411 |
|
|
<tr>
|
412 |
|
|
<td width="17"></td>
|
413 |
|
|
<td valign="middle"><a href="services_dnsmasq_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
|
414 |
|
|
</tr>
|
415 |
|
|
</table>
|
416 |
|
|
</td>
|
417 |
|
|
</tr>
|
418 |
|
|
</tfoot>
|
419 |
|
|
</table>
|
420 |
6661dbcf
|
jim-p
|
<br/>
|
421 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont">
|
422 |
|
|
<tr>
|
423 |
|
|
<td colspan="5" valign="top" class="listtopic"><?=gettext("Domain Overrides");?></td>
|
424 |
|
|
</tr>
|
425 |
|
|
<tr>
|
426 |
70edf50d
|
jim-p
|
<tr>
|
427 |
6661dbcf
|
jim-p
|
<td><p><?=gettext("Entries in this area override an entire domain by specifying an".
|
428 |
70edf50d
|
jim-p
|
" authoritative DNS server to be queried for that domain.");?></p></td>
|
429 |
|
|
</tr>
|
430 |
6661dbcf
|
jim-p
|
</tr>
|
431 |
70edf50d
|
jim-p
|
</table>
|
432 |
6661dbcf
|
jim-p
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable">
|
433 |
70edf50d
|
jim-p
|
<thead>
|
434 |
|
|
<tr>
|
435 |
|
|
<td width="35%" class="listhdrr"><?=gettext("Domain");?></td>
|
436 |
|
|
<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
|
437 |
|
|
<td width="35%" class="listhdr"><?=gettext("Description");?></td>
|
438 |
|
|
<td width="10%" class="list">
|
439 |
|
|
<table border="0" cellspacing="0" cellpadding="1">
|
440 |
|
|
<tr>
|
441 |
|
|
<td width="17" heigth="17"></td>
|
442 |
|
|
<td><a href="services_dnsmasq_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
|
443 |
|
|
</tr>
|
444 |
|
|
</table>
|
445 |
|
|
</td>
|
446 |
|
|
</tr>
|
447 |
|
|
</thead>
|
448 |
|
|
<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 |
|
|
<td valign="middle" nowrap class="list"> <a href="services_dnsmasq_domainoverride_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a>
|
461 |
|
|
<a href="services_dnsmasq.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"></a></td>
|
462 |
|
|
</tr>
|
463 |
|
|
<?php $i++; endforeach; ?>
|
464 |
|
|
</tbody>
|
465 |
|
|
<tfoot>
|
466 |
|
|
<tr>
|
467 |
|
|
<td class="list" colspan="3"></td>
|
468 |
|
|
<td class="list">
|
469 |
|
|
<table border="0" cellspacing="0" cellpadding="1">
|
470 |
|
|
<tr>
|
471 |
|
|
<td width="17" heigth="17"></td>
|
472 |
|
|
<td><a href="services_dnsmasq_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
|
473 |
|
|
</tr>
|
474 |
|
|
</table>
|
475 |
|
|
</td>
|
476 |
|
|
</tr>
|
477 |
|
|
</tfoot>
|
478 |
|
|
</table>
|
479 |
|
|
</form>
|
480 |
6a01ea44
|
Bill Marquette
|
<script language="JavaScript">
|
481 |
|
|
<!--
|
482 |
|
|
enable_change(false);
|
483 |
|
|
//-->
|
484 |
|
|
</script>
|
485 |
5b237745
|
Scott Ullrich
|
<?php include("fend.inc"); ?>
|
486 |
|
|
</body>
|
487 |
|
|
</html>
|