LinuxCommandLibrary

avahi-publish

Publish network services using Avahi (mDNS/DNS-SD)

SYNOPSIS

avahi-publish-service [options] <name> <type> <port> [<TXT-record> ...]
avahi-publish-address [options] <name> <IP-address>

PARAMETERS

-h, --help
    Display help and exit

-V, --version
    Output version information

-v, --verbose
    Increase verbosity

-d, --domain=<DOMAIN>
    Specify domain (default: local)

-i, --interface=<INTERFACE>
    Bind to specific network interface

-D, --no-daemonize
    Do not fork to background

-r, --no-reverse
    Disable reverse PTR records (service only)

DESCRIPTION

The avahi-publish command-line tool, part of the Avahi suite, enables publishing of network services and addresses using multicast DNS (mDNS) and DNS Service Discovery (DNS-SD) protocols on Linux systems. Avahi implements Apple's Zeroconf (Bonjour) for automatic service discovery without central servers.

This utility advertises services like web servers (_http._tcp), SSH (_ssh._tcp), printers (_ipp._tcp), or custom types, making them discoverable by compatible clients on the local LAN. It requires the avahi-daemon service to be running, which handles multicast announcements.

Service publication includes a human-readable name, standardized type, TCP/UDP port, and optional TXT records for metadata (e.g., path=/printer). Address publication binds hostnames to IPv4/IPv6 addresses. By default, it forks into the background as a daemon after registering.

Ideal for development, IoT devices, or ad-hoc networks lacking DHCP/DNS infrastructure. Supports multiple interfaces and domains like .local. Use with avahi-browse for verification.

CAVEATS

Requires running avahi-daemon(8). May conflict with firewall multicast blocks (udp/5353). Forks to daemon by default; use -D to stay in foreground. Limited to link-local scope (.local domain). Not for internet-wide publishing.

SERVICE EXAMPLE

avahi-publish-service myserver _http._tcp 8080 path=/docs

ADDRESS EXAMPLE

avahi-publish-address myhost 192.168.1.100

VERIFICATION

Run avahi-browse -a to confirm publication

HISTORY

Avahi developed since 2004 by Lennart Poettering and Trent Waddington as open-source Zeroconf for Linux. avahi-publish tools introduced in early releases (~0.6, 2005) alongside daemon. Evolved with IPv6 support, interface binding in later versions (0.7+). Maintained in systemd ecosystem.

SEE ALSO

Copied to clipboard