From e2a4b6df99bc191d903fc4f761346a8271078b05 Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 14 Nov 2021 20:31:34 +0100 Subject: [PATCH] add default hostname option --- templates/etc/dhcp/macros.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/etc/dhcp/macros.j2 b/templates/etc/dhcp/macros.j2 index 2a77d02..cf546c6 100644 --- a/templates/etc/dhcp/macros.j2 +++ b/templates/etc/dhcp/macros.j2 @@ -147,6 +147,7 @@ host {{ host.hostname }}-hw{{ loop.index }} { {% if not host.options is defined or (host.options and not 'host-name' in host.options) %} option host-name "{{ host.hostname }}"; {% endif %} + ddns-hostname "{{ host.hostname }}"; {% if host.address is defined and host.address %} fixed-address {{ host.address }}; {% endif %} @@ -160,6 +161,10 @@ host {{ host.hostname }} { {% if host.ethernet is defined and host.ethernet %} hardware ethernet {{ host.ethernet }}; {% endif %} +{% if not host.options is defined or (host.options and not 'host-name' in host.options) %} + option host-name "{{ host.hostname }}"; +{% endif %} + ddns-hostname "{{ host.hostname }}"; {% if host.address is defined and host.address %} {% if dhcpd_ipversion is defined and dhcpd_ipversion == '6' %} fixed-address6 {{ host.address }};