dhcp-to-dns: handle dns record by comment and type

This commit is contained in:
Christian Hesse 2023-04-12 23:09:58 +02:00
parent 83e57e6aab
commit f3876b0637

View file

@ -67,7 +67,7 @@ $ScriptLock $0 false 10;
:local HostName [ $CharacterReplace [ $EitherOr ([ $ParseKeyValueStore ($LeaseVal->"comment") ]->"hostname") ($LeaseVal->"host-name") ] " " "" ];
:local Domain ([ $IfThenElse ($ServerNameInZone = true) ($LeaseVal->"server" . ".") ] . $Zone);
:local DnsRecord [ /ip/dns/static/find where name=($MacDash . "." . $Domain) ];
:local DnsRecord [ /ip/dns/static/find where comment=$Comment (!type or type=A) ];
:if ([ :len $DnsRecord ] > 0) do={
:local DnsIp [ /ip/dns/static/get $DnsRecord address ];