From 01f1f2eceab41cdfce42f63f30c2b63de0f04382 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Sun, 7 Apr 2019 22:32:14 +0200 Subject: space_server: dhcpd: only do ddns for sane hostnames --- roles/space_server/templates/dhcpd.conf.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'roles/space_server/templates') diff --git a/roles/space_server/templates/dhcpd.conf.j2 b/roles/space_server/templates/dhcpd.conf.j2 index a156c52..d2e2ab6 100644 --- a/roles/space_server/templates/dhcpd.conf.j2 +++ b/roles/space_server/templates/dhcpd.conf.j2 @@ -75,7 +75,7 @@ subnet 10.42.1.0 netmask 255.255.255.0 { next-server 10.42.1.1; filename "pxelinux.0"; - if exists host-name { + if exists host-name and option host-name ~= "^[0-9A-Za-z-]*$" { ddns-hostname = option host-name; ddns-domainname "dhcp"; } else { @@ -98,7 +98,7 @@ subnet 10.42.2.0 netmask 255.255.255.0 { next-server 10.42.2.1; filename "pxelinux.0"; - if exists host-name { + if exists host-name and option host-name ~= "^[0-9A-Za-z-]*$" { ddns-hostname = option host-name; ddns-domainname "dhcp"; } else { @@ -119,7 +119,7 @@ subnet 10.42.3.0 netmask 255.255.255.0 { option domain-name-servers 185.38.175.0; #option ntp-servers 90.185.0.18; - if exists host-name { + if exists host-name and option host-name ~= "^[0-9A-Za-z-]*$" { ddns-hostname = option host-name; ddns-domainname "dhcp"; } else { @@ -140,7 +140,7 @@ subnet 10.42.3.0 netmask 255.255.255.0 { # option domain-name-servers 185.38.175.0; # #option ntp-servers 90.185.0.18; # -# if exists host-name { +# if exists host-name and option host-name ~= "^[0-9A-Za-z-]*$" { # ddns-hostname = option host-name; # ddns-domainname "dhcp"; # } else { -- cgit v1.2.1