This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.
Please visit our production wiki at https://wiki.gentoo.org
Avahi
avahi is a zeroconf service discovery and publishing program. A common use for it is to be able to connect to machines via yourhostname.local
within your LAN.
Installation
Kernel
Networking support ---> Networking options ---> [*] IP: multicasting
Server
root #
emerge --ask net-dns/avahi
Client
root #
emerge --ask sys-auth/nss-mdns
Configuration
Server Services
systemd
Enable the server to start whenever systemd thinks it is appropriate:
root #
systemctl enable avahi-daemon.service
If you want to use it right away, also start the service:
root #
systemctl start avahi-daemon.service
OpenRC
Be sure to add the service to the default runlevel for the server daemon to start on system boot. Do so with the rc-update command:
root #
rc-update add avahi-daemon default
Start the service (without restarting) with the rc-service command:
root #
rc-service avahi-daemon start
Client Files
Add the appropriate mdns into the hosts line in /etc/nsswitch.conf, An example line looks like:
/etc/nsswitch.conf
hosts: files mdns_minimal [NOTFOUND=return] dns mdns
Once this is installed it should be possible to ping the hostname of the machine appending .local
. For example:
root #
ping hostname.local