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 (192.168.0.135) 56(84) bytes of data.
64 bytes from atomic (192.168.0.135): 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
- nameserver 192.168.0.1 That is default DNS server (my router), .local hosts can't be resolved. Same result ifI use my ISP's DNS servers.
- nameserver 127.0.0.1 .local names are resolved, and nothing else for obvious reasons.
- nameserver 127.0.0.53 I copied it from my Ubuntu PC and everything works fine! Also, I get same result using Google's 8.8.8.8
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 127.0.0.53 or 8.8.8.8 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.