LinuxCommandLibrary

avahi-daemon

Advertise and discover services on a local network

SYNOPSIS

avahi-daemon [-h|-V|-D|-f|-d] [--daemonize] [--version] [--debug] [--file=FILE] [--no-rlimits] [--no-drop-root]

PARAMETERS

-h, --help
    Print brief usage information and exit

-V, --version
    Print version string and exit

-D, --daemonize
    Daemonize after startup (default unless -f used)

-f, --foreground
    Run in foreground, do not daemonize

-d, --debug
    Increase logging verbosity for debugging

--file=FILE
    Load configuration from specified FILE instead of default

--no-rlimits
    Skip setting resource limits (ulimit)

--no-drop-root
    Do not drop root privileges after startup

--kill-dns-servers
    Kill other mDNS/DNS-SD servers on startup

--chroot=DIR
    Chroot to directory DIR after startup

DESCRIPTION

Avahi is an open-source implementation of Zeroconf networking, providing multicast DNS (mDNS) and DNS service discovery (DNS-SD) for Linux and Unix-like systems. The avahi-daemon is the core system service that runs in the background, enabling automatic hostname resolution and service publishing/discovery on local networks without a central DNS server.

It allows devices and applications to advertise services like printers, file shares, or media servers, and discover them dynamically. For example, laptops can find shared printers seamlessly. Avahi integrates with D-Bus for inter-process communication, making it usable by desktop environments like GNOME and KDE.

Typically managed via systemd (systemctl start avahi-daemon), it reads configuration from /etc/avahi/avahi-daemon.conf. Services are defined in /etc/avahi/services/. It supports IPv4 and IPv6, wide-area announcements, and domain browsing. Security features include privilege dropping and chroot jails.

Common use cases include CUPS printing, Samba sharing, and UPnP media. It emulates Apple's Bonjour, ensuring cross-platform compatibility.

CAVEATS

Requires UDP port 5353 open in firewall. May conflict with systemd-resolved mDNS. Drops privileges by default; check logs (/var/log/syslog) for issues. Not for internet-wide use—local networks only.

CONFIGURATION

Main config: /etc/avahi/avahi-daemon.conf. Edit [server] section for host-name, domain. Services in /etc/avahi/services/*.service XML files.
Restart: systemctl restart avahi-daemon.

INTEGRATION

Publish services via D-Bus API or tools like avahi-publish. Browsable with avahi-browse -a. Enables zero-config features in apps like Rhythmbox, Nautilus.

HISTORY

Developed 2004-2006 by Lennart Poettering and Trent Lloyd as part of freedesktop.org. First stable release 0.6.10 in 2006. Now at version 0.8+, widely used in distributions like Ubuntu, Fedora. Replaced HOWL library.

SEE ALSO

avahi-browse(1), avahi-publish-service(1), avahi-discover(1), systemctl(1), dbus-daemon(1)

Copied to clipboard