I faced exactly the same issue on Linux Mint 21 while trying to set up my network printer. After a few hours of searching, I came across this blog post which confirmed what the manpages hinted at.
Essentially, you have to enable MulticastDNS
(a.k.a. mDNS
) for the interface that connects to your router, which is usually your wlan.
So first modify /etc/systemd/resolved.conf
[Resolve]
# Uncomment and set these values
DNS=192.168.1.1
Domains=local
MulticastDNS=yes
LLMNR=no
You have correctly identified that modifying this file only affects the Global
section of the resolvectl status
output. In order to change the configuration of the other links you have to create a separate .network
entry for every link (in my case, the wlan link had the name wlp2s0
; use your own name in the steps below).
Now create a new file
sudo touch /etc/systemd/network/wlp2s0.network
In that file, specify the configuration for the wlp2s0
link
[Match]
Name=wlp2s0
[Network]
DHCP=yes
MulticastDNS=yes
LLMNR=no
After that, enable and start systemd-networkd
if it isn't enabled by default
sudo systemctl enable systemd-networkd
sudo systemctl start systemd-networkd
Then check if the wlp2s0.network
configuration got loaded
networkctl list
Which should print
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 enp1s0 ether no-carrier unmanaged
3 wlp2s0 wlan routable configured
Lastly restart sytstemd-resolved
sudo systemctl restart systemd-resolved
and check the status
systemctl status
It should say
Global
Protocols: -LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: foreign
Current DNS Server: 192.168.1.1
DNS Servers: 192.168.1.1
DNS Domain: local
Link 2 (enp1s0)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 3 (wlp2s0)
Current Scopes: DNS mDNS/IPv4 mDNS/IPv6
Protocols: +DefaultRoute -LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.1.1
DNS Servers: 192.168.1.1 xxxx:xxx:xxxx:xxxx::x
DNS Domain: Home
Now you can try and ping your .local
domain
ping myprinter.local