Merge pull request #376 from N0YB/DNS_Query_Forwarding_Options

Services: DNS Forwarder
This commit is contained in:
Ermal Luçi 2013-02-04 23:45:02 -08:00
commit bef212d326
2 changed files with 33 additions and 0 deletions

View File

@ -1547,6 +1547,14 @@ function services_dnsmasq_configure() {
if(!isset($config['system']['webgui']['nodnsrebindcheck']))
$dns_rebind = "--rebind-localhost-ok --stop-dns-rebind";
if (isset($config['dnsmasq']['strict_order'])) {
$args .= " --strict-order ";
}
if (isset($config['dnsmasq']['domain_needed'])) {
$args .= " --domain-needed ";
}
if ($config['dnsmasq']['custom_options']) {
foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c)
$args .= " --$c";

View File

@ -48,6 +48,8 @@ $pconfig['enable'] = isset($config['dnsmasq']['enable']);
$pconfig['regdhcp'] = isset($config['dnsmasq']['regdhcp']);
$pconfig['regdhcpstatic'] = isset($config['dnsmasq']['regdhcpstatic']);
$pconfig['dhcpfirst'] = isset($config['dnsmasq']['dhcpfirst']);
$pconfig['strict_order'] = isset($config['dnsmasq']['strict_order']);
$pconfig['domain_needed'] = isset($config['dnsmasq']['domain_needed']);
$pconfig['custom_options'] = $config['dnsmasq']['custom_options'];
if (!is_array($config['dnsmasq']['hosts']))
@ -69,6 +71,8 @@ if ($_POST) {
$config['dnsmasq']['regdhcp'] = ($_POST['regdhcp']) ? true : false;
$config['dnsmasq']['regdhcpstatic'] = ($_POST['regdhcpstatic']) ? true : false;
$config['dnsmasq']['dhcpfirst'] = ($_POST['dhcpfirst']) ? true : false;
$config['dnsmasq']['strict_order'] = ($_POST['strict_order']) ? true : false;
$config['dnsmasq']['domain_needed'] = ($_POST['domain_needed']) ? true : false;
$config['dnsmasq']['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
if ($config['dnsmasq']['custom_options']) {
@ -191,6 +195,27 @@ function show_advanced_dns() {
"affects the name given for a reverse lookup (PTR)."));?></p>
</td>
</tr>
<tr>
<td rowspan="2" width="22%" valign="top" class="vncellreq"><?=gettext("DNS Query Forwarding");?></td>
<td width="78%" class="vtable"><p>
<input name="strict_order" type="checkbox" id="strict_order" value="yes" <?php if ($pconfig['strict_order'] == "yes") echo "checked";?>>
<strong><?=gettext("Query DNS servers sequentially");?><br>
</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
"query the DNS servers sequentially in the order specified (<i>System - General Setup - DNS Servers</i>), ".
"rather than all at once in parallel. ".
""), $g['product_name']); ?></p>
</td>
</tr>
<tr>
<td width="78%" class="vtable"><p>
<input name="domain_needed" type="checkbox" id="domain_needed" value="yes" <?php if ($pconfig['domain_needed'] == "yes") echo "checked";?>>
<strong><?=gettext("Require domain");?><br>
</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
"not forward A or AAAA queries for plain names, without dots or domain parts, to upstream name servers. ".
"If the name is not known from /etc/hosts or DHCP then a \"not found\" answer is returned. ".
""), $g['product_name']); ?></p>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
<td width="78%" class="vtable"><p>