From 6bca3c0f2a68b4c4a2a877de2fb8c343e8fda4f9 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Mon, 11 Aug 2025 00:32:03 +0200 Subject: Replace avahi with systemd-resolved/systemd-networkd --- roles/network/templates/NetworkManager.conf.j2 | 2 ++ roles/network/templates/resolved.conf.j2 | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 roles/network/templates/resolved.conf.j2 (limited to 'roles/network/templates') diff --git a/roles/network/templates/NetworkManager.conf.j2 b/roles/network/templates/NetworkManager.conf.j2 index 2fb39f4d..49dcd9bf 100644 --- a/roles/network/templates/NetworkManager.conf.j2 +++ b/roles/network/templates/NetworkManager.conf.j2 @@ -4,6 +4,7 @@ uri=https://ping.archlinux.org [main] dhcp=dhcpcd plugins=ifupdown,keyfile +dns=systemd-resolved [device-mac-randomization] wifi.scan-rand-mac-address=yes @@ -18,6 +19,7 @@ wifi.cloned-mac-address=stable ipv6.ip6-privacy=2 ipv6.dhcp-duid=stable-uuid wifi.powersave=2 +connection.mdns=2 [logging] level=INFO diff --git a/roles/network/templates/resolved.conf.j2 b/roles/network/templates/resolved.conf.j2 new file mode 100644 index 00000000..1893e882 --- /dev/null +++ b/roles/network/templates/resolved.conf.j2 @@ -0,0 +1,24 @@ +[Resolve] +DNS=1.1.1.1 2606:4700:4700::1111#cloudflare-dns.com 8.8.8.8 2001:4860:4860::8888#dns.google +FallbackDNS=1.0.0.1 2606:4700:4700::1001#cloudflare-dns.com 8.8.4.4 2001:4860:4860::8844#dns.google 9.9.9.9 2620:fe::fe#quad9.net + +DNSSEC=yes +DNSOverTLS=yes + +# Enable multicast DNS for .local domain resolution (replaces avahi functionality) +MulticastDNS=yes + +# Enable LLMNR for Windows network compatibility +LLMNR=yes + +Cache=yes +CacheFromLocalhost=no + +# Enable DNS stub listener on 127.0.0.53:53 +DNSStubListener=yes + +# Read /etc/hosts file +ReadEtcHosts=yes + +# Don't resolve single-label names via unicast DNS +ResolveUnicastSingleLabel=no -- cgit v1.2.3