Linux Commands Examples

A great documentation place for Linux commands


Register an mDNS/DNS-SD service or host name or address mapping using the Avahi daemon

see also : avahi-resolve - avahi-browse - avahi-daemon


avahi-publish -s [options] name service-type port [TXT data ...]

avahi-publish-service [options] name service-type port [TXT data ...]

avahi-publish -a [options] host name address

avahi-publish-address [options] host name address

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


listen="true" ;;
if ( which avahi-publish-service >/dev/null )
echo "error> avahi-publish-service not found in PATH, service announcement not enabled "


Register an mDNS/DNS-SD service or host name/address mapping using the Avahi daemon.


When calling in service registration mode, specify a DNS-SD service name (e.g. "Lennart’s Files"), a service type (e.g. _http._tcp) and an IP port number for the service, optionally followed by any number of TXT record strings on the command line. When calling in address/host name registration mode specify a fully qualified host name and an address (IPv4 or IPv6).
-s | --service

Register a service. avahi-publish-service is equivalent to avahi-publish -s.

-a | --address

Register an address/host name mapping. avahi-publish-address is equivalent to avahi-publish -a.

-v | --verbose

Enable verbose mode.

-H | --host= HOSTNAME

Specify a host name for this service, in case it doesn’t reside on the local host. This host name needs to be fully qualified and resolvable using mDNS or unicast DNS.

-d | --domain= DOMAIN

Publish the service in the specified domain. If omitted the Avahi daemon will publish it in its default domain (usually .local).

--subtype= SUBTYPE

Register the service with an additional subtype in addition to the main type. DNS-SD subtypes have the form _anon._sub._ftp._tcp, where _anon is the identifier of the subtype and _ftp._tcp is the main type. You may pass this option multiple times to register the service with multiple subtypes.

-f | --no-fail

Don’t fail if the daemon is not found running. Instead, wait until it appears. If it disconnects, try to reconnect.

-h | --help

Show help

-V | --version

Show version information.


This man page was written using xml2man(1) by Oliver Kurth.

see also

avahi-resolve , avahi-browse , avahi-daemon


The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from

How can this site be more helpful to YOU ?

give  feedback