LinuxCommandLibrary

avahi-publish-address

Register mDNS hostname-to-address mappings

TLDR

Register a hostname to IP address mapping

$ avahi-publish-address [hostname] [ip_address]
copy
Register an IPv4 address with a hostname
$ avahi-publish-address myserver.local 192.168.1.100
copy
Register an IPv6 address with a hostname
$ avahi-publish-address myserver.local fe80::1
copy
Register in verbose mode
$ avahi-publish-address -v [hostname] [ip_address]
copy
Register in a specific domain
$ avahi-publish-address --domain=[domain] [hostname] [ip_address]
copy
Register without reverse DNS entry
$ avahi-publish-address --no-reverse [hostname] [ip_address]
copy

SYNOPSIS

avahi-publish-address [options] hostname address

DESCRIPTION

avahi-publish-address is a command-line utility for registering hostname-to-address mappings via the Avahi daemon using mDNS (Multicast DNS). This command is equivalent to avahi-publish -a and provides a convenient shortcut specifically for address registration.
The tool enables local network name resolution by advertising a hostname and its associated IPv4 or IPv6 address. The hostname typically resolves as hostname.local on the local network, allowing other devices to discover and connect to the host by name rather than by IP address.
When invoked, avahi-publish-address connects to the Avahi daemon and maintains the hostname-to-address mapping until the process is terminated. The mapping is automatically withdrawn when the process exits.
By default, the tool publishes both forward (name-to-address) and reverse (address-to-name) DNS entries. The reverse entry can be suppressed using the --no-reverse option. The protocol can be explicitly specified using --proto when needed, though the tool automatically detects the protocol from the address format.
The published hostname becomes discoverable by other mDNS-capable devices on the local network segment, including Linux systems with Avahi, macOS systems with Bonjour, and Windows systems with appropriate mDNS support.

PARAMETERS

-v, --verbose

Enable verbose output with detailed information
-d, --domain=DOMAIN
Specify mDNS domain name to register in (defaults to .local)
-P, --proto=PROTO
Specify IP protocol to publish (ipv4, ipv6, or all)
-R, --no-reverse
Do not publish reverse DNS (PTR) entry for the address
-f, --no-fail
Continue and reconnect if daemon becomes unavailable
-h, --help
Display help information
-V, --version
Show version information

CAVEATS

Requires avahi-daemon to be running. The hostname registration persists only while the avahi-publish-address process is active; terminating the process removes the mapping. For persistent hostname registration, configure static mappings in /etc/avahi/hosts.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community