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.
This commit is contained in:
Christian Hesse 2024-02-19 11:03:17 +01:00
parent 872abbea7d
commit b286cb6803

View file

@ -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 . \