Correct way to enable mDNS on Fedora Server 34?

What is the correct way to enable responding to and resolution of *.local domain names on Fedora Server 34? (aka “Multicast DNS” or “mDNS”)

I already got this working, but I’m not confident I did it the recommended way. In my research I found a lot of confusing information about avahi-daemon, nss-mdns, systemd-resolved, systemd-networkd, /etc/nsswitch.conf, authselect, /etc/systemd/resolved.conf, NetworkManager, etc.

Anyway, the solution I went with was to:

  1. Set MulticastDNS=yes in /etc/systemd/resolved.conf.
  2. Create a file /etc/NetworkManager/conf.d/enable-mdns.conf with connection.mdns=2 set in the [connection] section.
  3. Reboot.

Q: What is the recommended way to enable mDNS resolver and responder on Fedora Server 34?


Additionally, I found that mDNS was working out the box on my Siverblue system. I wasn’t able to figure out what configuration option or package was making that happen in order to replicate it on my Fedora Server system. It didn’t have the configuration entries that I added to my Fedora Server system…

Q: What package or piece of configuration enables mDNS by default on Fedora Silverblue (and presumeably Workstation)?

Well, here I am 2+ years later, looking for the same thing for Fedora Server 39. There must be something else in the normal Workstation variants.

As far as I can gather, Workstation variants works out of the box. Server variant doesnt.

On Workstation, mDNS is not enabled by default, global or per interface and that worked fine. Avahi is installed by default.

On Server, i enabled the mDNS as discussed above, it didnt work for me. I am still looking what would make it work.

mDNS can work as explained in the OP using systemd-resolved with nss-resolve or using Avahi like Fedora Workstation does by default, although both methods have their own pros and cons.

Thanks for your reply. Seems like there is something I missed then. I will dig further into Avahi route to use something similar to the Workstation.

I was able to resolve this issue now - turns out I hadnt enabled UDP 5353 for mdns avahi service to work.

I would suggest to go Cockpit http://<your.server.ip>:9090 and add it there.

Then:
sudo systemctl reload firewalld

On Fedora 39 server, I just enabled by sudoedit /etc/systemd/resolved.conf and enable MulticastDNS=yes , finally sudo systemctl restart systemd-resolved

nsswitch.conf doesn’t show mdns entry but resolution appears to work. I will see if it’s gonna work during early boot because this is what I need it for :grimacing:

update: it doesn’t run in early boot but I need static config anyway so not going to figure out enabling it

avahi + nss-mdns Is needed for printer discovery and sharing. Otherwise you can remove avahi and nss-mdns and enable mDNS in systemd-resolved.

1 Like