diff options
-rw-r--r-- | dhcp-to-dns | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/dhcp-to-dns b/dhcp-to-dns index d769bf6..8edb45b 100644 --- a/dhcp-to-dns +++ b/dhcp-to-dns @@ -42,6 +42,9 @@ :set DhcpIp [ / ip dhcp-server lease get $Lease address ]; :local Comment ("managed by dhcp-to-dns for " . $Mac); :set HostName [ $CharacterReplace [ / ip dhcp-server lease get $Lease host-name ] " " "" ]; + :if ($HostName = "") do={ + :set HostName [ $CharacterReplace [ / ip dhcp-server lease get $Lease mac-address ] ":" "-" ]; + } :if ([ :len $HostName ] > 0) do={ :set Fqdn ($HostName . "." . $Zone); |