aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-notify.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-02-19 11:03:17 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-02-19 11:03:17 +0100
commitb286cb680326ff31ad3592aeace5962cf0377072 (patch)
tree288e55d6870c303cc25077b2a818156e3a5e653d /netwatch-notify.rsc
parent872abbea7d147a8c6291270ba9389731e998b1e0 (diff)
netwatch-notify: do not update with record in cache
Using `:resolve` we have just one address, but chances are several records do exist. These end up in cache, so we are happy to find them there - no need to update then.
Diffstat (limited to 'netwatch-notify.rsc')
-rw-r--r--netwatch-notify.rsc3
1 files changed, 2 insertions, 1 deletions
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc
index ae9c8a8..77b0e69 100644
--- a/netwatch-notify.rsc
+++ b/netwatch-notify.rsc
@@ -79,7 +79,8 @@ $ScriptLock $0;
:if ([ $IsDNSResolving ] = true) do={
:do {
:local Resolve [ :resolve ($HostInfo->"resolve") ];
- :if ($Resolve != $HostVal->"host") do={
+ :if ($Resolve != $HostVal->"host" and \
+ [ :len [ /ip/dns/cache/find where name=($HostInfo->"resolve") data=[ :tostr ($HostVal->"host") ] ] ] = 0) do={
$LogPrintExit2 info $0 ("Name '" . $HostInfo->"resolve" . [ $IfThenElse \
($HostInfo->"resolve" != $HostInfo->"name") ("' for " . $Type . " '" . \
$HostInfo->"name") "" ] . "' resolves to different address " . $Resolve . \