From e88c2a806721c8a12ec6f16d78c723f3050f4eff Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Fri, 12 Apr 2024 09:52:32 +0300 Subject: [PATCH] etc: attempt to enable mDNS/LLMNR for systemd-{networkd,resolved} & NetworkManager Some boolean fixing slipped in as well --- etc/NetworkManager/conf.d/mdns.conf | 4 ++++ etc/resolv.conf | 2 ++ etc/systemd/network/10-ether.network | 12 +++++++++--- etc/systemd/network/10-wlan.network | 10 ++++++++-- etc/systemd/resolved.conf.d/00-defaults.conf | 4 ++++ 5 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 etc/NetworkManager/conf.d/mdns.conf diff --git a/etc/NetworkManager/conf.d/mdns.conf b/etc/NetworkManager/conf.d/mdns.conf new file mode 100644 index 00000000..b6ec66ca --- /dev/null +++ b/etc/NetworkManager/conf.d/mdns.conf @@ -0,0 +1,4 @@ +# Enables mDNS for systemd-resolved +[connection] +connection.mdns=2 +connection.llmnr=2 diff --git a/etc/resolv.conf b/etc/resolv.conf index f313a7ad..fc304133 100644 --- a/etc/resolv.conf +++ b/etc/resolv.conf @@ -20,6 +20,8 @@ options rotate edns0 trust-ad # no sending local domain to upstream whenever NXDOMAIN happens search . +# Attempt to mDNS everything? +#search .local # PS. Remove empty lines and comments if this ends up in /etc/resolv.conf # PPS. The traditional spell is: diff --git a/etc/systemd/network/10-ether.network b/etc/systemd/network/10-ether.network index e8ad43e1..c313278a 100644 --- a/etc/systemd/network/10-ether.network +++ b/etc/systemd/network/10-ether.network @@ -7,14 +7,16 @@ Type=ether [Link] # My devices generally also have WiFi so lack of ethernet is not a reason # to wait for systemd-networkd-wait-online.service -RequiredForOnline=no +RequiredForOnline=false # Takes "ipv4", "ipv6", "both", or "any" (default). RequiredFamilyForOnline=both -# Always set administrative state to up. Implies RequiredForOnline=yes +# Always set administrative state to up. Implies RequiredForOnline=true #ActivationPolicy=always-up +# Required for mDNS +Multicast=true [Network] -#DHCP=yes +#DHCP=true # /24, /16, /8 are the the class C, B, A networks Address=192.168.0.2/24 Gateway=192.168.0.1 @@ -30,3 +32,7 @@ IPv6LinkLocalAddressGenerationMode=stable-privacy # multiple times, but you are using Chrony instead, right? #NTP=fi.pool.ntp.org #NTP=time.cloudflare.com +# Enable mDNS/.local for systemd-resolved +MulticastDNS=true +# Windows +LLMNR=true diff --git a/etc/systemd/network/10-wlan.network b/etc/systemd/network/10-wlan.network index 7ddc8e46..839ce67a 100644 --- a/etc/systemd/network/10-wlan.network +++ b/etc/systemd/network/10-wlan.network @@ -7,13 +7,19 @@ Type=wlan [Link] # Takes "ipv4", "ipv6", "both", or "any" (default). RequiredFamilyForOnline=both -# Always set administrative state to up. Implies RequiredForOnline=yes +# Always set administrative state to up. Implies RequiredForOnline=true ActivationPolicy=always-up # If something else (like iwd EnableNetworkConfiguration=true) manages network, # uncomment #Unmanaged=true +# Required for mDNS +Multicast=true [Network] -DHCP=yes +DHCP=true IPv6PrivacyExtensions=true IPv6LinkLocalAddressGenerationMode=stable-privacy +# Enable mDNS/.local for systemd-resolved +MulticastDNS=true +# Windows +LLMNR=true diff --git a/etc/systemd/resolved.conf.d/00-defaults.conf b/etc/systemd/resolved.conf.d/00-defaults.conf index 8856629f..0cb7b64e 100644 --- a/etc/systemd/resolved.conf.d/00-defaults.conf +++ b/etc/systemd/resolved.conf.d/00-defaults.conf @@ -10,3 +10,7 @@ Cache=true DNS=127.0.0.1 DNS=::1 Domains=~. +# .local domains +MulticastDNS=true +# Microsoft Windows compatibility? +LLMNR=true