I installed Avahi with libnss-mdns to be able to access my pi by hostname. Relevant info:

$ cat /etc/hostname

$ ps ax | grep avahi
2103 ?        S      0:00 avahi-daemon: running [raspberrypi.local]
2104 ?        S      0:00 avahi-daemon: chroot helper

$ sudo service avahi-daemon status
Avahi mDNS/DNS-SD Daemon is running

ls -l /etc/avahi/services/
total 8
-rw-r--r-- 1 root root 449 Jul 31 13:16 multiple.service
-rw-r--r-- 1 root root 299 Mar 10 17:15 udisks.service

And on the pi itself it is working:

$ avahi-browse -a
+   eth0 IPv4 XBMC (raspberrypi)                            _airplay._tcp        local
+   eth0 IPv4 B827EBA83303@XBMC (raspberrypi)               AirTunes Remote Audio local
+   eth0 IPv4 XBMC (raspberrypi)                            _xbmc-jsonrpc._tcp   local
+   eth0 IPv4 XBMC (raspberrypi)                            _xbmc-events._udp    local
+   eth0 IPv4 XBMC (raspberrypi)                            _xbmc-jsonrpc-h._tcp local
+   eth0 IPv4 XBMC (raspberrypi)                            Web Site             local
+   eth0 IPv4 raspberrypi                                   Remote Disk Management local
+   eth0 IPv4 raspberrypi                                   _device-info._tcp    local
+   eth0 IPv4 raspberrypi                                   SSH Remote Terminal  local
+   eth0 IPv4 raspberrypi [b8:27:eb:a8:33:03]               Workstation          local

Although I only see local services (and there are others that I can see on my Mac).

On my Mac I can't see it (with Bonjour Browser.app) or resolve:

⌘ ping raspberrypi.local
ping: cannot resolve raspberrypi.local: Unknown host

The other way around does not work either:

$ ping Tino.local
ping: unknown host Tino.local

They are on the same network (192.168.178.x) and I can ssh into the pi and back into my mac. I have rebooted multiple times already.

What next steps can I take?


In case someone else stumbles upon this, this might be useful:

  • you could try avahi-resolve to see if it's a problem with the NSS integration or the actual hostname resolution

  • try a tcpdump -i wlan0 port 5353 or igmp -w /tmp/mdns.pcap (IGMP) and wireshark /tmp/mdns.pcap (should work from both the pi and your laptop) to inspect what's sent over the wire and see who's not doing what they are supposed to

Better late than never ...

  • Definitely. I tried avahi-resolve -n Tino.local and it works now! No idea what changed in the past 6 months (had given up a little) but pinging works on both sides now. Thanks for the help anyway – Tino Jan 17 '15 at 12:07

You can check the name used by using service or systemctl

alexis@Oreo:~$ sudo systemctl status avahi-daemon
[sudo] password for alexis: 
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor pre
   Active: active (running) since Wed 2021-02-03 08:33:50 CET; 5h 50min ago
 Main PID: 1692 (avahi-daemon)
   Status: "avahi-daemon 0.7 starting up."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/avahi-daemon.service
           ├─1692 avahi-daemon: running [Oreo.local]
           └─1708 avahi-daemon: chroot helper

You can fix it by editing /etc/avahi/avahi-daemon.conf and rebooting (or restarting the service)

  • This prompted me to check my avahi-daemon.conf file and I discovered that I had an allow-interfaces= line that didn't list my network adapter. – matth Mar 17 at 14:19

Try them on the same network hub, not going through a router. Thus, both on the same line out of your router, then they might be able to hear each other.

  • 1
    What do you mean? "on the same line out of your router"? They are both on the LAN side, so the router functions as a hub. It should work with a router as well btw. – Tino Oct 20 '14 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.