Wayne's own answer is quite old by now. Arch has since switched to using systemd instead of init scripts.
The Arch wiki's Avahi page has been updated and contains details on why the steps below are needed. In short: Avahi is a zeroconf tool, meaning itself needs no configuration to work once installed on all machines your LAN, but you must configure the rest of your software so it actuall asks Avahi for the information.
Run these as root, or prepend with sudo
where appropriate, in a terminal and replace nano
with the editor of your choice.
pacman -S avahi nss-mdns
Installs the Avahi services daemon and the Multicast DNS resolver.
nano /etc/nsswitch.conf
This file tells the C library how to obtain name-service information.
- Change the line
hosts: files dns myhostname
to hosts: files mdns_minimal [NOTFOUND=return] dns myhostname
, save and exit.
systemctl start avahi-daemon
Starts the Avahi service manually since we're already booted.look for errors)
systemctl enable avahi-daemon
Enables the Avahi service on boot.
I just performed these steps on an Arch laptop and there was no need to restart any other services or the wifi interface to have my other machines discover it within a few seconds, and have my laptop discover their services.
Since I can't comment on ggg's answer yet, I'd just like to point out here that there is no need to do this in a startup script -- that's what enabling the service in systemd is for. Do it once and forget about it.
avahi
as well asnss-mdns
- for more details have a look at the arch wiki