diff --git a/roles/dhcpd/templates/dhcpd.conf.j2 b/roles/dhcpd/templates/dhcpd.conf.j2 index 1b57821..ab46ea8 100644 --- a/roles/dhcpd/templates/dhcpd.conf.j2 +++ b/roles/dhcpd/templates/dhcpd.conf.j2 @@ -50,7 +50,9 @@ subnet {{ subnet.address|ipv4('network') }} netmask {{ subnet.address|ipv4('netm filename "{{ subnet.boot_filename }}"; {% endif %} {% endif %} -{% if subnet.dynamic_hostnames|d|bool %} +{% if not subnet.ddns_updates|d(true)|bool %} + ddns-updates off; +{% elif subnet.dynamic_hostnames|d|bool %} option host-name = {{ dyn_hostname_expr.format(prefix=subnet.dyn_hostname_prefix|d(default_dyn_hostname_prefix)) }}; ddns-hostname = {{ dyn_hostname_expr.format(prefix=subnet.dyn_hostname_prefix|d(default_dyn_hostname_prefix)) }}; {% endif %}