avahi-browse is a command-line tool in Linux that is used to browse the network for available services that are advertised using the Avahi service discovery protocol. Avahi is a free, open-source implementation of the Zeroconf protocol, which allows devices on a local network to automatically discover and communicate with each other without the need for a central server or configuration.
avahi-browse can be used to discover services on the local network, such as printers, web servers, or file servers, and display information about them, such as their type, name, and IP address. It can also be used to monitor the network for changes in the availability of services, and to receive notifications when services are added or removed.
You can use avahi-browse to discover services on the local network by running the avahi-browse command with the appropriate options. For example, to discover all available services on the local network, you could use the following command:
# avahi-browse --all
If you encounter the below error while running the avahi-browser command:
avahi-browse: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install avahi-utils |
Ubuntu | apt-get install avahi-utils |
Alpine | apk add avahi |
Arch Linux | pacman -S avahi |
Kali Linux | apt-get install avahi-utils |
CentOS | yum install avahi-tools |
Fedora | dnf install avahi-tools |
Raspbian | apt-get install avahi-utils |
For more information on using avahi-browse, you can consult the avahi-browse documentation or use the avahi-browse –help command to view a list of available options and usage examples.
avahi-browse Command Examples
1. List all services available on the local network along with their addresses and ports while ignoring local ones:
# avahi-browse --all --resolve --ignore-local
2. List all domains:
# avahi-browse --browse-domains
3. Limit the search to a particular domain:
# avahi-browse --all --domain=domain