Table of Contents

Avahi

Avahi is software for Linux that provides multicast DNS.

OS X

OS X will use mDNS to lookup any hostnames ending in .local

OS X seems to cache mDNS entries, even if a service and/or server goes away. To test:

Finder Bugs

Finder has bugs related to browsing services with zeroconf. See also Samba wiki page for Finder bugs related there as well.

Samba

Avahi will advertise services for a Samba server, regardless of whether a smb.service entry exists or not.

Hosts

You can advertise subnets and hosts with mDNS by adding entries to the hosts file in /etc/avahi.

Every service advertised by avahi must also have an entry in the hosts file.

A service for VNC for vnc.local, the hosts file needs to advertise the IP address for vnc.local as well.

Services

MDNS allows OS X to “see” services that are available through Finder. You can add custom services, which is useful for something that doesn't advertise over MDNS by default.

For example, if a server is running a service on another network, but you still want it visible from the existing LAN, you can add a custom service.

Each service has its own file in /etc/avahi/services/ that must end in a .service suffix.

Configuration

Configuration file is found at /etc/avahi/avahi-daemon.conf

Here are some common settings that may affect the network:

Here are some other settings that will probably not need to be modified:

Examples

gentoo.local and netatalk

In /etc/avahi/hosts:

192.168.13.2 gentoo.local

In /etc/avahi/afp.service:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">gentoo</name>
  <service>
    <type>_device-info._tcp</type>
    <port>0</port>
    <!-- Customize this to get a different icon in the Finder. -->
    <txt-record>model=PowerMac</txt-record>
    <host-name>gentoo.local</host-name>
  </service>
  <service>
    <type>_afpovertcp._tcp</type>
    <port>548</port>
    <host-name>gentoo.local</host-name>
  </service>
</service-group>
cloud.local and Samba

In /etc/avahi/hosts:

192.168.12.184 nas.local

In /etc/avahi/smb.service:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">nas</name>
  <service>
    <type>_device-info._tcp</type>
    <port>0</port>
    <txt-record>model=PowerMac</txt-record>
    <host-name>nas.local</host-name>
  </service>
  <service>
    <type>_smb._tcp</type>
    <port>445</port>
    <host-name>nas.local</host-name>
  </service>
</service-group>
win5.local and VNC

In /etc/avahi/hosts:

192.168.12.205 win5.local

In /etc/avahi/vnc.service:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">win5</name>
  <service>
    <type>_device-info._tcp</type>
    <port>0</port>
    <host-name>win5.local</host-name>
  </service>
  <service>
    <type>_rfb._tcp</type>
    <port>5900</port>
    <host-name>win5.local</host-name>
  </service>
</service-group>