[2/2] dns.cgi: Force a reload after every change
Commit Message
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(-)
@@ -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