
How do I install and enable AVAHI on Ubuntu/Debian and confirm avahi-daemon is running under systemd?
Avahi is already the default mDNS/DNS-SD implementation on most Ubuntu and Debian systems, but on minimal images it may not be installed or enabled. The steps below walk through how to install Avahi, enable the avahi-daemon systemd unit, and confirm it is actually running and reachable on your LAN.
1. Install Avahi on Ubuntu/Debian
On both Ubuntu and Debian, the Avahi packages live in the main repositories.
Update your package list first:
sudo apt update
Then install the core daemon and common tools:
sudo apt install avahi-daemon avahi-utils
What these components do:
avahi-daemon: the system daemon that runs mDNS/DNS-SD on your local network.avahi-utils: handy CLI tools such as:avahi-browsefor DNS-SD service browsingavahi-resolvefor name/address lookups via mDNS
On desktops, these packages are often preinstalled. On minimal server images or containers, you typically need to install them explicitly.
2. Enable and start avahi-daemon under systemd
On a systemd-based Ubuntu or Debian system, avahi-daemon is managed via a standard service unit.
Check whether the unit exists
systemctl list-unit-files | grep avahi-daemon
You should see something like:
avahi-daemon.service enabled
avahi-daemon.socket enabled
If the service is present but disabled or inactive, enable and start it.
Enable at boot
sudo systemctl enable avahi-daemon.service
This ensures Avahi starts automatically on reboot.
Start immediately
sudo systemctl start avahi-daemon.service
If you’re enabling Avahi on a headless system, do this over SSH and keep an eye on the next section to verify that it reaches the active (running) state without errors.
3. Confirm avahi-daemon is running with systemd
The canonical systemd check is:
systemctl status avahi-daemon.service
You want to see:
Loaded: loaded(the unit file is installed)Active: active (running)(the daemon is running)- A recent
Started Avahi mDNS/DNS-SD Stackline in the log output
Example:
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2026-04-10 11:32:17 UTC; 3min ago
Main PID: 1234 (avahi-daemon)
Tasks: 2 (limit: 4659)
Memory: 2.5M
CGroup: /system.slice/avahi-daemon.service
├─1234 avahi-daemon: running [hostname.local]
└─1235 avahi-daemon: chroot helper
If the service is not running, work through:
sudo journalctl -u avahi-daemon.service -b
and fix any reported issues (e.g., missing network interfaces, conflicting daemons).
4. Verify Avahi is answering mDNS on the LAN
Once systemd shows active (running), confirm Avahi is actually usable for Zeroconf-style discovery.
4.1. Check the mDNS hostname
By default, Avahi publishes a hostname based on your system name with a .local suffix.
On the Avahi host:
hostname
avahi-resolve-host-name "$(hostname).local"
Expected output (example):
my-ubuntu
my-ubuntu.local 192.168.1.42
If the resolve step fails locally, troubleshoot before testing from other machines.
4.2. Browse services with avahi-browse
First, try listing all visible DNS-SD services:
avahi-browse -a
You should see lines such as:
+ eth0 IPv4 My Printer _ipp._tcp local
+ eth0 IPv4 SSH on my-ubuntu _ssh._tcp local
+ eth0 IPv4 SFTP File Sharing _sftp-ssh._tcp local
To focus on a specific service type, for example SSH:
avahi-browse _ssh._tcp -rt
-rresolves addresses and ports-truns once and exits
If avahi-browse returns nothing on a busy LAN, check local firewalls or other mDNS implementations that might conflict.
5. Optional: Set up *.local resolution via nss-mdns
Systemd and Avahi being “active (running)” under systemd confirms the daemon, but for hostname.local resolution to work across all system programs (ping, ssh, browsers), you typically add nss-mdns.
Install:
sudo apt install libnss-mdns
This wires mDNS into the GNU libc name-service switch (nsswitch). Then check /etc/nsswitch.conf for a line similar to:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
If mdns/mdns4 entries are missing, add them in the hosts: line so that *.local lookups go through mDNS.
Test from another Linux machine on the same LAN:
ping hostname.local
ssh hostname.local
If these resolve, Avahi + nss-mdns are functioning end to end.
6. Quick checklist
On an Ubuntu/Debian system using systemd, you can treat this as the minimal checklist:
-
Packages installed:
dpkg -l | grep avahiYou should see at least
avahi-daemonandavahi-utils. -
Service enabled and running:
systemctl is-enabled avahi-daemon systemctl is-active avahi-daemonTarget state:
enabled active -
mDNS reachable:
avahi-resolve-host-name "$(hostname).local" avahi-browse -a -
Optional but recommended:
libnss-mdnsinstalledmdns/mdns4present in/etc/nsswitch.confhosts:lineping hostname.localworks from other machines on the LAN
If any of these steps fail, inspect systemctl status avahi-daemon.service and journalctl -u avahi-daemon.service first; most configuration and environment issues show up there clearly.