Update (6 Dec 2021):
It seems like there is a bug somewhere in avahi or libnss_mdns, see https://github.com/lathiat/nss-mdns/issues/81
Bad timing.

I have 2 single board computers running Debian 11, none of which is able to resolve any host in .local domain using mDNS out of the box. Here is the ping's output running on junk.local:

brain@junk:~$ ping atom.local    
ping: atom.local: Name or service not known

Pinging atom.local from my PC running Ubuntu, works okay:

brain@home:~$ ping atom.local
PING atom.local ( 56(84) bytes of data.
64 bytes from atomic ( icmp_seq=1 ttl=64 time=0.394 ms

Both of them are accessible by their names, "atom.local" and "junk.local" using Ubuntu 21.10, Windows and iOS. The hardware are same, both machines get their network settings through DHCP service on my router. On the atom.local network is managed by networking (basic server installation), on the junk.local - by NetworkManager (desktop + KDE installation). I tried a lot of guides, configuring avahi, nsswitch, systemd-resolved, NetworkManager, non of which working for me. Tinkering with /etc/resolv.conf I was able to get some results

  1. nameserver That is default DNS server (my router), .local hosts can't be resolved. Same result ifI use my ISP's DNS servers.
  2. nameserver .local names are resolved, and nothing else for obvious reasons.
  3. nameserver I copied it from my Ubuntu PC and everything works fine! Also, I get same result using Google's

Now I have a question: How do I properly configure this mDNS thing? Why it is working fine with Google DNS server? I'm a bit confused after reading a ton of howtos and answers on this site.

In my nsswitch.conf I have this line:

hosts:          files mdns4_minimal [NOTFOUND=return] dns

avahi-resolve and avahi-browse works fine on these machines.

If I use or as a nameserver, I get IPV6 address

brain@junk:~$ getent hosts atom.local
fe80::207:32ff:fe4e:7d17 atom.local

So this mdns4_minimal does nothing at all? Now I'm totally confused.

  • mDNS and DNS are two different protocols; also IPv4 and IPv6 are too different network stacks. The ideas seem to be a bit mixed up Dec 6, 2021 at 18:16
  • @Rui F Ribeiro Yes, I know. Very helpful, thank you very much Dec 6, 2021 at 18:42

1 Answer 1


For minimal server install it is enough use combo systemd-networkd + systemd-resolved.

sudo nano /etc/systemd/resolved.conf Uncomment MulticastDNS=yes

sudo nano /etc/systemd/network/10-lan.network I used simple configuration:

Name=enp1s0 #Put your interface here


Enable networkd and resolved services, start them up:

sudo systemctl enable systemd-networkd
sudo systemctl enable systemd-resolved
sudo systemctl start systemd-networkd
sudo systemctl start systemd-resolved

Disable/mask default networking service:

sudo systemctl disable networking

Rename or remove old networking stuff, this step is crucial to keep /etc/resolv.conf controlled by resolved service:

sudo mv /etc/network/interfaces /etc/network/interfaces.save

Finally it works, yay!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .