From 7c07cfbb0cb2da24db779beae13660f071b3bffd Mon Sep 17 00:00:00 2001 From: David Mandelberg Date: Sun, 19 May 2024 19:41:41 -0400 Subject: [PATCH] Don't put short hostnames in DNS, mostly IPv4 addresses from static leases are still showing up as short names in DNS, and I don't see a way to prevent that. https://superuser.com/questions/966051/how-to-prevent-local-host-name-resolving-from-dhcp-names-in-openwrt-dnsmasq#comment1331091_966052 mentions it but doesn't have a solution. --- salt/file/network/home_router/dnsmasq.conf.jinja | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/salt/file/network/home_router/dnsmasq.conf.jinja b/salt/file/network/home_router/dnsmasq.conf.jinja index 140085d..ad45f1a 100644 --- a/salt/file/network/home_router/dnsmasq.conf.jinja +++ b/salt/file/network/home_router/dnsmasq.conf.jinja @@ -79,10 +79,9 @@ dhcp-option=tag:noDefaultRoute,option:router {%- for interface_ip_config in interface.ip if 'interface_id' in interface_ip_config %} -host-record={{ '{}.{},{},10.{}.{}.{},{}:{:02x}{:02x}::{:x}'.format( +host-record={{ '{}.{},10.{}.{}.{},{}:{:02x}{:02x}::{:x}'.format( grains.host, subdomain, - grains.host, site.id, segments[interface.segment].id, interface_ip_config.interface_id, @@ -141,10 +140,9 @@ dhcp-host={{ '{},{}{},[{}],{}'.format( lease_time, ) }} {%- for short_host_name in [other_host_name] + other_host.get('aliases', []) %} -host-record={{ '{}.{},{},{},{}'.format( +host-record={{ '{}.{},{},{}'.format( short_host_name, subdomain, - short_host_name, other_host_ipv4, other_host_ipv6_ula, ) }}