aboutsummaryrefslogtreecommitdiffstats
path: root/dhcp-to-dns
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp-to-dns')
-rw-r--r--dhcp-to-dns3
1 files changed, 2 insertions, 1 deletions
diff --git a/dhcp-to-dns b/dhcp-to-dns
index 352b53f..4e2c7f2 100644
--- a/dhcp-to-dns
+++ b/dhcp-to-dns
@@ -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 ];