netwatch-notify: restore the check 🥴

This reverts commit 28da1da49e.

Chances are that we have to resolve a CNAME, that does not match when
querying the cache.

How to handle CNAME do multiple A records? 🤨
This commit is contained in:
Christian Hesse 2024-02-27 17:56:08 +01:00
parent 28da1da49e
commit d4e79d6fd3

View file

@ -79,7 +79,8 @@ $ScriptLock $0;
:if ([ $IsDNSResolving ] = true) do={
:do {
:local Resolve [ :resolve ($HostInfo->"resolve") ];
:if ([ :len [ /ip/dns/cache/find where name=($HostInfo->"resolve") data=[ :tostr ($HostVal->"host") ] ] ] = 0) do={
:if ($Resolve != $HostVal->"host" && \
[ :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 . \