Skip to content

Commit

Permalink
Don't put short hostnames in DNS, mostly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dseomn committed May 19, 2024
1 parent 9968bf0 commit 7c07cfb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions salt/file/network/home_router/dnsmasq.conf.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
) }}
Expand Down

0 comments on commit 7c07cfb

Please sign in to comment.