LinuxCommandLibrary

avahi-publish-service

Publish network services using Avahi

SYNOPSIS

avahi-publish-service [-h|--help] [-v|--verbose] [-s|--subtype ] [-t|--txt ]

PARAMETERS

-h, --help
    Show help options.

-v, --verbose
    Enable verbose output.

-s, --subtype
    Announce a subtype of the service.
For example, _printer._tcp._local. might have a subtype _ipp._tcp._local.

-t, --txt
    Add a TXT record to the service.
For example: "key=value".


    The name of the service to publish. This is what will be displayed to users.


    The service type to advertise, must follow the format `_service._protocol`.
Example: `_http._tcp` or `_ssh._tcp`.


    The port number the service is running on.

DESCRIPTION

The `avahi-publish-service` command allows you to advertise services on a local network using mDNS (Multicast DNS) and DNS-SD (DNS Service Discovery) protocols, implemented by Avahi. This enables other devices on the network to discover the service without needing explicit configuration. It essentially announces the existence of a service, like a printer or an SSH server, along with relevant details like its port number and the protocols it supports. This eliminates the need for manual IP address configuration, making service discovery much simpler.
The command requires the service type, the port number, and a list of text records. Text records can include service specific information like the printer model, the SSH key fingerprint, or other application-specific data. Once the service is published, it becomes discoverable by other Avahi-enabled devices on the network. The service will continue to be advertised until `avahi-publish-service` is terminated. Avahi needs to be running on the system for this command to work, as it relies on the Avahi daemon for handling the mDNS/DNS-SD announcements.

CAVEATS

Avahi must be running on the system for this command to work. The service is only announced on the local network.

SERVICE TYPES

Refer to the DNS-SD specifications for a comprehensive list of registered service types. You can also define your own custom service types.

TEXT RECORDS

Text records provide additional information about the service. Use them to include details like device model, supported features, or other relevant data for client applications. Keep TXT records short to stay within size limits of mDNS packets.

HISTORY

Avahi is a system for simplifying service discovery on a local network. It implements Apple's Bonjour protocol, which is itself an implementation of the mDNS and DNS-SD specifications. `avahi-publish-service` is a command-line utility included with Avahi to easily publish services without requiring complex configuration files or programming.

SEE ALSO

Copied to clipboard