[2/2] dns.cgi: Force a reload after every change

Message ID 20261113134243.382773-3-antonio@mandelbit.com
State New
Headers
Series Fix DNS-over-TLS after changing DNS settings (#14781) |

Commit Message

Antonio Quartulli 13 Nov 2026, 1:42 p.m. UTC
The workers only set up DNS-over-TLS forwarders at startup, so after
enabling TLS they sent plain DNS to port 853 until knot-resolver was
restarted. Changes to the server list didn't reload at all.

Fixes: #14781
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
---
 html/cgi-bin/dns.cgi | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
  

Patch

diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi
index 713b0a308..d0080f7b6 100644
--- a/html/cgi-bin/dns.cgi
+++ b/html/cgi-bin/dns.cgi
@@ -105,9 +105,6 @@  if ($cgiparams{'GENERAL'} eq _('Save')) {
 		# Call function to handle unbound restart, etc.
 		&_handle_unbound_and_more()
 	}
-
-	# Reload DNS
-	&General::system_background("/usr/local/bin/dnsctrl", "reload");
 }
 
 ###
@@ -823,6 +820,10 @@  END
 
 # Private function to handle the restart of unbound and more.
 sub _handle_unbound_and_more () {
+	# Reload DNS and restart the workers, as they only read the
+	# forwarders when they start
+	&General::system_background("/usr/local/bin/dnsctrl", "force-reload");
+
 	# Check if the IDS is running.
 	if(&IDS::ids_is_running()) {
 		# Re-generate the file which contains the DNS Server