aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-dns
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-02-07 09:58:53 +0100
committerGravatar Christian Hesse <mail@eworm.de>2022-02-10 08:41:12 +0100
commita47f5723cc4cdd287d36aaffd7619c17494f9345 (patch)
tree57f75eb4d6759f4207dca38ad00d593e70e1041f /netwatch-dns
parent0b46c508dc8f76955dd528900882b54c07b62ef3 (diff)
netwatch-dns: flush cache on configuration change
Diffstat (limited to 'netwatch-dns')
-rw-r--r--netwatch-dns4
1 files changed, 4 insertions, 0 deletions
diff --git a/netwatch-dns b/netwatch-dns
index e731d95..e2fcfa3 100644
--- a/netwatch-dns
+++ b/netwatch-dns
@@ -43,12 +43,14 @@ $ScriptLock $0;
:if ($DnsServers != $DnsCurrent) do={
$LogPrintExit2 info $0 ("Updating DNS servers: " . [ :tostr $DnsServers ]) false;
/ ip dns set servers=$DnsServers;
+ / ip dns cache flush;
}
} else={
:if ([ :len $DnsFallback ] > 0) do={
:if ($DnsFallback != $DnsCurrent) do={
$LogPrintExit2 info $0 ("Updating DNS servers to fallback: " . [ :tostr $DnsFallback ]) false;
/ ip dns set servers=$DnsFallback;
+ / ip dns cache flush;
}
}
}
@@ -69,10 +71,12 @@ $ScriptLock $0;
:if ($DohServer != $DohCurrent) do={
$LogPrintExit2 info $0 ("Updating DoH server: " . $DohServer) false;
/ ip dns set use-doh-server=$DohServer;
+ / ip dns cache flush;
}
} else={
:if ($DohCurrent != "") do={
$LogPrintExit2 info $0 ("DoH server (" . $DohCurrent . ") is down, disabling.") false;
/ ip dns set use-doh-server="";
+ / ip dns cache flush;
}
}