aboutsummaryrefslogtreecommitdiffstats
path: root/dhcp-to-dns
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp-to-dns')
-rw-r--r--dhcp-to-dns5
1 files changed, 4 insertions, 1 deletions
diff --git a/dhcp-to-dns b/dhcp-to-dns
index a7a05ad..1dc3b42 100644
--- a/dhcp-to-dns
+++ b/dhcp-to-dns
@@ -76,7 +76,10 @@ $ScriptLock $0 false 10;
}
:if ([ :len ($LeaseVal->"host-name") ] > 0) do={
- :set ($LeaseVal->"address") [ / ip dhcp-server lease get ([ find where host-name=($LeaseVal->"host-name") status=bound ]->0) address ];
+ :local HostNameLeases [ / ip dhcp-server lease find where host-name=($LeaseVal->"host-name") status=bound ];
+ :if ([ :len $HostNameLeases ] > 1) do={
+ :set ($LeaseVal->"address") [ / ip dhcp-server lease get ($HostNameLeases->0) address ];
+ }
}
:if ($DnsIp = $LeaseVal->"address") do={