Let Mac OS auto-discover your SMB shares


Mac OS can mount and read SMB shares. But with Samba only, you have to tell the Mac where there are. With avahi-daemon, SMB shares will be automatically discovered.

Install the Avahi service discovery suite. Chances are it was already installed by dependancies magic. If not, package is easy to find.

Once installed, find the location for configuration files and locate the “services” directory. On FreeBSD 11, go to /usr/local/etc/avahi/services. From there, create the following file:

# cat smb.service
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
  <name replace-wildcards="yes">%h</name>

Configure the automatic start and launch avahi-daemon.

On the Mac, go to Network and… tada, here are the SMB shares. You already did install & configure Samba, didn’t you?

Bonus: you can set various value for txt-record. This will lead to a specific icon in the Finder.
Some options are :

Et voilĂ . So that’s what the daemon does… Among others things.