Local domains with mDNS
In this guide, we walk through making your server available by name on your local network via mDNS.
This is useful in small networks, homelabs, or any other environment where clients exist on the same subnet as the server.
About mDNS
mDNS, short for Multicast DNS, resolves hostnames to IP addresses by broadcasting queries directly to all hosts on the local network using multicast.
mDNS has a special .local top-level domain, and domains ending in .local are resolved via mDNS instead of DHCP or a DNS server.
With mDNS configured, you can access your server without knowing its IP address, without setting up a DNS server, and without modifying /etc/hosts.
Do I already have mDNS?
You can test whether your server responds to mDNS queries by pinging your server from another device, using both its IP address and its local domain <hostname>.local, where <hostname> is the hostname of your server.
For example, if your hostname is fedora, your mDNS domain name is fedora.local:
Here is a successful ping via IP address:
$ ping -c 3 192.168.1.10
PING 192.168.1.10 (192.168.1.10) 56(84) bytes of data.
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=3.64 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=3.77 ms
64 bytes from 192.168.1.10: icmp_seq=3 ttl=64 time=4.04 ms
--- 192.168.1.10 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 3.635/3.814/4.042/0.169 ms
Here is an unsuccessful ping via local domain:
$ ping -c 3 fedora.local
ping: fedora.local: Name or service not known
If your server is on the same network and responds to ping via IP but not via local domain, mDNS is not configured. Read on to learn how to configure mDNS.
Install Avahi
Avahi provides an implementation of mDNS that is available on most, if not all, Linux distributions.
Avahi may already be installed, but if it isn’t, install with dnf:
$ sudo dnf install avahi
Enable Avahi
On Fedora, Avahi runs as a service unit named avahi-daemon.service.
You can check the service status using systemctl status avahi-daemon.service to see if Avahi is already enabled:
$ systemctl status avahi-daemon.service
○ avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; disabled; preset: enabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: inactive (dead) since Thu 2026-07-16 22:19:55 PDT; 1min 2s ago
...
It is disabled, so let’s enable it:
$ sudo systemctl enable --now avahi-daemon.service
Created symlink '/etc/systemd/system/dbus-org.freedesktop.Avahi.service' → '/usr/lib/systemd/system/avahi-daemon.service'.
Created symlink '/etc/systemd/system/multi-user.target.wants/avahi-daemon.service' → '/usr/lib/systemd/system/avahi-daemon.service'.
Created symlink '/etc/systemd/system/sockets.target.wants/avahi-daemon.socket' → '/usr/lib/systemd/system/avahi-daemon.socket'.
avahi-daemon.service is running:
$ systemctl status avahi-daemon.service
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; preset: enabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: active (running) since Thu 2026-07-16 22:22:37 PDT; 42s ago
...
No additional configuration is necessary for Avahi itself.
Allow mDNS traffic
With Avahi enabled, Fedora’s firewall still blocks the port by default.
Fedora uses firewalld to manage its firewall, so we use firewall-cmd to open the mDNS port:
$ sudo firewall-cmd --permanent --add-service=mdns
success
$ sudo firewall-cmd --reload
success
Verify domain resolution
Your server should now be reachable from fedora.local:
$ ping fedora.local
PING fedora.local (192.168.1.231) 56(84) bytes of data.
64 bytes from 192.168.1.231: icmp_seq=1 ttl=64 time=4.39 ms
With Avahi enabled, you can access your server by name and you may never need to know its IP address again.
Want to help? Learn how to contribute to Fedora Docs ›