Press "Enter" to skip to content

How to set up Avahi on Arch Linux

Roberto Leon 0

Next week I’ll be traveling to the Switch Las Vegas aka “SuperNAP” or “NAP7” data centers for the implementation/deployment of multiple technologies (Cisco, Nutanix, VMware, Rubrik, etc). As part of the planning & technical design tasks, I noticed I’ll have to bootstrap a four(4) node Rubrik, for which I’ll need the following:

Rubrik uses multicast DNS (mDNS) for node-to-node discovery and to initiate system set up. The computer that is used to perform the system set up (System Setup UI computer) must be connected to the same layer-2 segment as the Rubrik nodes. The System Setup UI computer also must have a supported web browser and specific mDNS software.

The System Setup UI computer can be a server, desktop, laptop, or virtual machine.
The System Setup UI computer must have the following:

– Latest version of Google Chrome web browser
– Bonjour Print Services software
– IPv6 support enabled

Rubrik CDM Install and Upgrade Guide, Version 5.0

Since my main laptop runs Arch Linux and I’m not carrying a Mac, which includes the Bonjour Services out-of-the-box, I figured that Avahi was my go-to for this task. So I did a quick search and found out that (as always with Arch Linux), the setup for this was pretty straight-forward and clearly explained in the Arch Wiki. Here it goes:

  • Install the required packages:
$ pacman -S avahi nss-mdns gtk3 python-dbus python-gobject
  • Enable the Avahi daemon in order to make it persistent after reboot:
$ systemctl enable avahi-daemon.service
  • Start the DBus (if not already running) & Avahi daemons:
$ systemctl start dbus.service
$ systemctl start avahi-daemon.service
  • Edit the nssmdns configuration file located on “/etc/nsswitch.conf” and change the hosts line to include “mdns4_minimal [NOTFOUND=return]” before resolve and dns, and include the “mdns4” module at the end (optional):

hosts: … mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns … mdns4

After this, you can use the utilities that come included with Avahi (avahi-browse, avahi-discover, avahi-resolve, etc.) or the Avahi Zeroconf Browser utilities (bssh, bvnc for SSH & VNC Servers) in order to discover and connect to your devices.

$ bssh
$ avahi-browse --all --ignore-local --resolve --terminate
$ avahi-resolve -n device-hostname.local
$ ssh user@device-hostname.local
Additional considerations:

Make sure you open UDP port 5353 if you’re using a firewall.


Arch Linux Wiki

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *