mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 10:04:19 +02:00
dhcp-to-dns: add support for dhcp server name in fqdn
This commit is contained in:
parent
354be9c222
commit
2e1acc2505
|
@ -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 ];
|
||||
|
|
|
@ -34,6 +34,7 @@ The configuration goes to `global-config-overlay`, these are the parameters:
|
|||
* `Domain`: the domain used for dns records
|
||||
* `HostNameInZone`: whether or not to add the dhcp/dns server's hostname
|
||||
* `PrefixInZone`: whether or not to add prefix `dhcp`
|
||||
* `ServerNameInZone`: whether or not to add DHCP server name
|
||||
|
||||
See also
|
||||
--------
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
:global Domain "example.com";
|
||||
:global HostNameInZone true;
|
||||
:global PrefixInZone true;
|
||||
:global ServerNameInZone false;
|
||||
|
||||
# These addresses are used to send e-mails to. The to-address needs
|
||||
# to be filled; cc-address can be empty, one address or a comma
|
||||
|
|
Loading…
Reference in a new issue