From dedb11793547e270aa65cab8778eda4fc6663ebe Mon Sep 17 00:00:00 2001 From: agh1467 <7823088+agh1467@users.noreply.github.com> Date: Fri, 31 Dec 2021 10:13:24 +0000 Subject: [PATCH] dnsmasq: no hosts option; closes #5374 * Add checkbox to enable --no-hosts command line option --- src/etc/inc/plugins.inc.d/dnsmasq.inc | 4 ++++ src/www/services_dnsmasq.php | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/src/etc/inc/plugins.inc.d/dnsmasq.inc b/src/etc/inc/plugins.inc.d/dnsmasq.inc index 30c14a3bb..30267efe8 100644 --- a/src/etc/inc/plugins.inc.d/dnsmasq.inc +++ b/src/etc/inc/plugins.inc.d/dnsmasq.inc @@ -184,6 +184,10 @@ function dnsmasq_configure_do($verbose = false) $args .= ' --log-queries=extra '; } + if (isset($config['dnsmasq']['no_hosts'])) { + $args .= ' --no-hosts '; + } + $args .= ' --dns-forward-max=5000 '; $args .= ' --cache-size=10000 '; $args .= ' --local-ttl=1 '; diff --git a/src/www/services_dnsmasq.php b/src/www/services_dnsmasq.php index 51761f835..ece40c921 100644 --- a/src/www/services_dnsmasq.php +++ b/src/www/services_dnsmasq.php @@ -49,6 +49,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['strictbind'] = isset($a_dnsmasq['strictbind']); $pconfig['dnssec'] = isset($a_dnsmasq['dnssec']); $pconfig['log_queries'] = isset($a_dnsmasq['log_queries']); + $pconfig['no_hosts'] = isset($a_dnsmasq['no_hosts']); // simple text types $pconfig['port'] = !empty($a_dnsmasq['port']) ? $a_dnsmasq['port'] : ""; // arrays @@ -81,6 +82,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $a_dnsmasq['domain_needed'] = !empty($pconfig['domain_needed']); $a_dnsmasq['no_private_reverse'] = !empty($pconfig['no_private_reverse']); $a_dnsmasq['log_queries'] = !empty($pconfig['log_queries']); + $a_dnsmasq['no_hosts'] = !empty($pconfig['no_hosts']); $a_dnsmasq['strictbind'] = !empty($pconfig['strictbind']); $a_dnsmasq['dnssec'] = !empty($pconfig['dnssec']); if (!empty($pconfig['regdhcpdomain'])) { @@ -355,6 +357,13 @@ $( document ).ready(function() { +