Hello, I’m new to Fedora (but not to Linux in general) and in general I like it a lot. This one problem has me stumped though. mDNS name hostname resolution isn’t working. Avahi is able to resolve the hostname when I use avahi-resolve-host-name, but getent hosts doesn’t resolve it. For example, with an mDNS-enabled printer:
I’m not sure what’s wrong here since Avahi seems to be working fine on its own. Here’s what I’ve tried:
Checking firewall configuration: mDNS is allowed (and anyway, Avahi works on its own)
Adding 127.0.0.1 to NetworkManager’s additional DNS servers for my connection config. (this adds a nameserver 127.0.0.1 line to /etc/resolv.conf.
Adding an /etc/mdns.allow file with the default settings to allow .local domains.
Switching Avahi to use .alocal instead of .local in /etc/avahi/avahi-daemon.conf in case the router’s DNS server handles the .local TLD already.
I don’t think my configuration is out of the ordinary anywhere else. I installed Fedora using the minimal install media and then gradually installed the packages that I want/need. Here’s some configuration lines that might be relevent:
hosts line from /etc/nsswitch.conf: hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
Just for your information. I don’t have avahi installed, but executing getent hosts xpress-c1860fw.local followed by echo $? returns the same number 2. However, if I do the same for a host I know exists, i get the entries for that host from getent.
Are you sure it is not just a problem with the xpress host?
P.S. I may be a longtime fedora user, but I never used avahi and I am certainly not server knowledgeable. Hope you can forgive if this is a newby query xD.
If your had started with the minimal install media, maybe then your setup is having a systemd-resolved running instead of the avahi-daemon.service?
" Note:systemd-resolved has a built-in multicast DNS service, make sure to disable systemd-resolved’s mDNS resolver and responder or disablesystemd-resolved.service entirely before using Avahi. For details, refer to resolved.conf(5).
I tried uncommenting publish-resolv-conf-dns-servers=yes in avahi-daemon.conf and restarting Avahi, but it didn’t change anything. And there aren’t any relevant errors when I do journalctl --boot | grep denied
I wish I know how to debug something like this with GDB or something.
Side note 1: What helped me figure this out was the --service parameter for the getent command. By using getent --service=mdns hosts xpress-c1860fw I was able to bypass the sequence of services specified in /etc/nsswitch.conf and isolate the problem to the mdns4_minimal NSS service. The red flag was the fact that getent would return immediately, so I know that there was no network activity going on. Apparently mdns4_minimal is broken.
Side note 2: I really don’t understand why mdns4_minimal doesn’t work. It ought to. Maybe this deserves a bug report?