mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-03 17:54:36 +02:00
dhcp-to-dns: add support for dhcp server name in fqdn
This commit is contained in:
parent
354be9c222
commit
2e1acc2505
3 changed files with 4 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
:global HostNameInZone;
|
||||
:global Identity;
|
||||
:global PrefixInZone;
|
||||
:global ServerNameInZone;
|
||||
|
||||
:global CharacterReplace;
|
||||
:global IfThenElse;
|
||||
|
@ -46,7 +47,7 @@
|
|||
[ $CharacterReplace ($LeaseVal->"mac-address") ":" "-" ] \
|
||||
[ $CharacterReplace ($LeaseVal->"host-name") " " "" ] ];
|
||||
|
||||
:local Fqdn ($HostName . "." . $Zone);
|
||||
:local Fqdn ($HostName . "." . [ $IfThenElse ($ServerNameInZone = true) ($LeaseVal->"server" . ".") ] . $Zone);
|
||||
:local DnsRecord [ / ip dns static find where name=$Fqdn ];
|
||||
:if ([ :len $DnsRecord ] > 0) do={
|
||||
:local DnsIp [ / ip dns static get $DnsRecord address ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue