54 |
54 |
$pconfig['port'] = $config['dnsmasq']['port'];
|
55 |
55 |
$pconfig['custom_options'] = $config['dnsmasq']['custom_options'];
|
56 |
56 |
|
|
57 |
$pconfig['strictbind'] = isset($config['dnsmasq']['strictbind']);
|
|
58 |
$pconfig['interface'] = explode(",", $config['dnsmasq']['interface']);
|
|
59 |
|
57 |
60 |
if (!is_array($config['dnsmasq']['hosts']))
|
58 |
61 |
$config['dnsmasq']['hosts'] = array();
|
59 |
62 |
|
... | ... | |
77 |
80 |
$config['dnsmasq']['domain_needed'] = ($_POST['domain_needed']) ? true : false;
|
78 |
81 |
$config['dnsmasq']['no_private_reverse'] = ($_POST['no_private_reverse']) ? true : false;
|
79 |
82 |
$config['dnsmasq']['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
|
|
83 |
$config['dnsmasq']['strictbind'] = ($_POST['strictbind']) ? true : false;
|
80 |
84 |
|
81 |
85 |
if ($_POST['port'])
|
82 |
86 |
if(is_port($_POST['port']))
|
... | ... | |
86 |
90 |
else if (isset($config['dnsmasq']['port']))
|
87 |
91 |
unset($config['dnsmasq']['port']);
|
88 |
92 |
|
89 |
|
if ($_POST['port'])
|
90 |
|
if(!is_port($_POST['port']))
|
91 |
|
$input_errors[] = gettext("You must specify a valid port number");
|
|
93 |
if (is_array($_POST['interface']))
|
|
94 |
$config['dnsmasq']['interface'] = implode(",", $_POST['interface']);
|
|
95 |
elseif (isset($config['dnsmasq']['interface']))
|
|
96 |
unset($config['dnsmasq']['interface']);
|
92 |
97 |
|
93 |
98 |
if ($config['dnsmasq']['custom_options']) {
|
94 |
99 |
$args = '';
|
... | ... | |
250 |
255 |
<?=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>
|
251 |
256 |
</td>
|
252 |
257 |
</tr>
|
|
258 |
<tr>
|
|
259 |
<td width="22%" valign="top" rowspan="2" class="vncellreq"><?=gettext("Interfaces"); ?></td>
|
|
260 |
<td width="78%" class="vtable">
|
|
261 |
<?php
|
|
262 |
$interface_addresses = get_possible_listen_ips(true);
|
|
263 |
$size=count($interface_addresses)+1;
|
|
264 |
?>
|
|
265 |
<?=gettext("Interface IPs used to respond to queries from the DNS Forwarder. In 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.");?>
|
|
266 |
<br /><br />
|
|
267 |
<select id="interface" name="interface[]" multiple="true" class="formselect" size="<?php echo $size; ?>">
|
|
268 |
<option value="">All</option>
|
|
269 |
<?php foreach ($interface_addresses as $laddr):
|
|
270 |
$selected = "";
|
|
271 |
if (in_array($laddr['value'], $pconfig['interface']))
|
|
272 |
$selected = 'selected="selected"';
|
|
273 |
?>
|
|
274 |
<option value="<?=$laddr['value'];?>" <?=$selected;?>>
|
|
275 |
<?=htmlspecialchars($laddr['name']);?>
|
|
276 |
</option>
|
|
277 |
<?php endforeach; ?>
|
|
278 |
</select>
|
|
279 |
<br />
|
|
280 |
</td>
|
|
281 |
</tr>
|
|
282 |
<tr>
|
|
283 |
<td width="78%" class="vtable"><p>
|
|
284 |
<input name="strictbind" type="checkbox" id="strictbind" value="yes" <?php if ($pconfig['strictbind'] == "yes") echo "checked";?>>
|
|
285 |
<strong><?=gettext("Strict Interface Binding");?></strong>
|
|
286 |
<br />
|
|
287 |
<?= gettext("If this option is set, the DNS forwarder will only bind to the interfaces selected above, rather than binding to all interfaces and discarding queries to other addresses."); ?>
|
|
288 |
<br /><br />
|
|
289 |
<?= gettext("NOTE: This option does NOT work with IPv6. If set, dnsmasq will not bind to IPv6 addresses."); ?>
|
|
290 |
</p>
|
|
291 |
</td>
|
|
292 |
</tr>
|
253 |
293 |
<tr>
|
254 |
294 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
|
255 |
295 |
<td width="78%" class="vtable"><p>
|
Add the ability for dnsmasq to selectively respond to queries only on certain IPs and bind to specific interfaces.