← 返回命令列表

Linux command

avahi-publish-address 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Register

avahi-publish-address [hostname] [ip_address]

Register

avahi-publish-address myserver.local 192.168.1.100

Register

avahi-publish-address myserver.local fe80::1

Register

avahi-publish-address -v [hostname] [ip_address]

Register

avahi-publish-address --domain=[domain] [hostname] [ip_address]

Register

avahi-publish-address --no-reverse [hostname] [ip_address]

说明

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 (IPv4 or IPv6) is automatically determined 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.

参数

-v, --verbose
Enable verbose output with detailed information
-d, --domain=_DOMAIN_
Specify mDNS domain name to register in (defaults to .local)
-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

FAQ

What is the avahi-publish-address command used for?

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 (IPv4 or IPv6) is automatically determined 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.

How do I run a basic avahi-publish-address example?

Run `avahi-publish-address [hostname] [ip_address]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -v, --verbose do in avahi-publish-address?

Enable verbose output with detailed information