mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
dnsmasq: test all options, unify style
This commit is contained in:
parent
9dae2099b5
commit
5cf5e5974a
@ -112,7 +112,7 @@ function dnsmasq_configure_do($verbose = false)
|
||||
|
||||
$args = '';
|
||||
if (!isset($config['system']['webgui']['nodnsrebindcheck'])) {
|
||||
$args .= "--rebind-localhost-ok --stop-dns-rebind";
|
||||
$args .= '--rebind-localhost-ok --stop-dns-rebind';
|
||||
}
|
||||
|
||||
$args .= ' -H /var/etc/dnsmasq-hosts ';
|
||||
@ -146,43 +146,35 @@ function dnsmasq_configure_do($verbose = false)
|
||||
}
|
||||
|
||||
if (!empty($addresses) && isset($config['dnsmasq']['strictbind'])) {
|
||||
$args .= " --bind-interfaces ";
|
||||
$args .= ' --bind-interfaces ';
|
||||
}
|
||||
}
|
||||
|
||||
/* Prevent bogus lookups of unknown private ranges */
|
||||
if (isset($config['dnsmasq']['no_private_reverse'])) {
|
||||
$args .= " --bogus-priv ";
|
||||
$args .= ' --bogus-priv ';
|
||||
}
|
||||
|
||||
/* Setup forwarded domains */
|
||||
if (isset($config['dnsmasq']['domainoverrides']) && is_array($config['dnsmasq']['domainoverrides'])) {
|
||||
foreach ($config['dnsmasq']['domainoverrides'] as $override) {
|
||||
if ($override['ip'] == "!") {
|
||||
$override['ip'] = "";
|
||||
}
|
||||
$args .= ' --server='. escapeshellarg('/' . $override['domain'] . '/' . $override['ip']);
|
||||
foreach (config_read_array('dnsmasq', 'domainoverrides') as $override) {
|
||||
if ($override['ip'] == '!') {
|
||||
$override['ip'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
/* Allow DNS Rebind for forwarded domains */
|
||||
if (isset($config['dnsmasq']['domainoverrides']) && is_array($config['dnsmasq']['domainoverrides'])) {
|
||||
$args .= ' --server='. escapeshellarg('/' . $override['domain'] . '/' . $override['ip']);
|
||||
|
||||
if (!isset($config['system']['webgui']['nodnsrebindcheck'])) {
|
||||
foreach ($config['dnsmasq']['domainoverrides'] as $override) {
|
||||
$args .= ' --rebind-domain-ok=' . escapeshellarg('/'.$override['domain'].'/') . ' ';
|
||||
}
|
||||
$args .= ' --rebind-domain-ok=' . escapeshellarg('/'.$override['domain'].'/') . ' ';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($config['dnsmasq']['strict_order'])) {
|
||||
$args .= " --strict-order ";
|
||||
$args .= ' --strict-order ';
|
||||
}
|
||||
|
||||
if (isset($config['dnsmasq']['domain_needed'])) {
|
||||
$args .= " --domain-needed ";
|
||||
$args .= ' --domain-needed ';
|
||||
}
|
||||
|
||||
if (!empty($config['dnsmasq']['dnssec'])) {
|
||||
if (isset($config['dnsmasq']['dnssec'])) {
|
||||
$args .= ' --dnssec ';
|
||||
$args .= ' --trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 ';
|
||||
$args .= ' --trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D ';
|
||||
@ -197,6 +189,7 @@ function dnsmasq_configure_do($verbose = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$args .= ' ' . implode(' ', array_values($standard_args));
|
||||
|
||||
_dnsmasq_add_host_entries();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user