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:
Set MulticastDNS=yes in /etc/systemd/resolved.conf.
Create a file /etc/NetworkManager/conf.d/enable-mdns.conf with connection.mdns=2 set in the [connection] section.
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)?
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.
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
update: it doesn’t run in early boot but I need static config anyway so not going to figure out enabling it
I can’t edit my previous answer anymore. In Fedora 41 /etc/systemd/resolved.conf does not exist. You can create it or just /etc/systemd/resolved.conf.d/dns.conf. In both cases you need to put the configuration option under the section [Resolve]. i.e.
[Resolve]
MulticastDNS=yes
You can check the locations where systemd-resolved looks for its configuration file in man resolved.conf. Also don’t forget to restart the resolved service.
Either way, to finally make mdns available, you need to also enable it in firewall. e.g.