From b286cb680326ff31ad3592aeace5962cf0377072 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 19 Feb 2024 11:03:17 +0100 Subject: 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. --- netwatch-notify.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'netwatch-notify.rsc') 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 . \ -- cgit v1.2.3-54-g00ecf