diff --git a/templates/etc/dhcp/auto_options.j2 b/templates/etc/dhcp/auto_options.j2 index 72eb0cf..7c0a656 100644 --- a/templates/etc/dhcp/auto_options.j2 +++ b/templates/etc/dhcp/auto_options.j2 @@ -9,7 +9,12 @@ option dhcp6.domain-search "{{ dhcpd_tpl_domain_search | join('", "') }}"; {% if dhcpd_nameservers|d() and dhcpd_nameservers %} {% set dhcpd_tpl_nameservers = dhcpd_nameservers %} {% elif dhcpd_runtime_nameservers|d() and dhcpd_runtime_nameservers %} -{% set dhcpd_tpl_nameservers = dhcpd_runtime_nameservers %} +{% set dhcpd_tpl_nameservers = [] %} +{% for server in dhcpd_runtime_nameservers %} +{% if server not in [ '127.0.0.1', '::1' ] %} +{% set _ = dhcpd_tpl_nameservers.append(server) %} +{% endif %} +{% endfor %} {% endif %} {% if dhcpd_tpl_nameservers %} {% if dhcpd_tpl_nameservers | ipv4 %}