My Raspberry Pi is not discoverable via its hostname in my LAN.

I have a couple of other Ubuntu machines in the LAN, and they are all pingable via their hostnames.

On my Raspberry Pi:

pi@raspberrypi ~ $ hostname

On another machine in the same LAN:

ping raspberrypi
ping: unknown host raspberrypi
  • Duplicate question: unix.stackexchange.com/questions/77189/…. Closed as off-topic as this is a general Linux networking issue, not related to the Raspberry Pi.
    – Jivings
    Jun 7, 2013 at 6:54
  • 1
    Why is it not releated to Raspberry Pi if I have an Odroid with Ubuntu 14.04, a MÎNIX with Debian and a virtual PC I boot with Ubuntu 15.10 in the same network without this issue? Only on my Raspberry Pi 2 with Raspian I have this issue since I upgraded to Jessie.
    – user38336
    Jan 18, 2016 at 14:24
  • just as a side note, this will probably not affect most people out there reading this, but some people might have avahi installed and wondering why it's not working for them -> one possibility is that your network configuration doesn't support multicast.
    – Lukas1
    Jul 4, 2016 at 5:41
  • @clamp Shouldn't it be ping raspberrypi.local, I think that the .local part is vital Jan 22, 2018 at 11:00

2 Answers 2


Have you tried doing a ping test using the IP address? If that works your problem is usually with resolving the name to an IP address.

There are many ways to fix this. You could

  • Add an entry to your /etc/hosts file with your pi's static-ip and hostname
  • Add a static reservation to your dhcp server and add a record to your local dns server (If your router supports it)
  • Run a service like NIS, Avahi or Samba on your pi. The choice depends on the OS you are pinging from.
    • Windows clients will benefit from installing Samba.
    • OS/X clients will benefit from Avahi or Samba.
    • Linux clients will probably benefit from NIS or Samba depending on what is installed. I guess the Ubuntu computers use samba to advertise their hostnames.
  • yeah pinging via the ip is fine, but it does not have a static ip address.
    – clamp
    May 26, 2013 at 21:20
  • What OS are you pinging the pi and ubuntu boxes from? If you are on a linux machine could you see what the value of hosts: is in your /etc/nsswitch.conf? May 26, 2013 at 21:22
  • 2
    Thanks. I've solved mine via Samba. Samba will be useful at some point as its a bit easier to access files this way
    – fedmich
    Mar 14, 2016 at 16:02

You have to use avahi-daemon (zeroconf) if you want to connect via a hostname instead of an IP address. From the Raspberry Pi documentation on RPi Advanced Setup:

Install avahi with the following commands on the Raspberry Pi:

sudo apt-get install avahi-daemon

Update boot startup for avahi-daemon

sudo insserv avahi-daemon

Apply the new configuration with:

sudo /etc/init.d/avahi-daemon restart

The Raspberry Pi should now be addressable from other machines as raspberrypi.local, for example: ssh [email protected] or http://raspberrypi.local if you have HTTP service installed.

If you couldn't connect from Windows PCs via SSH probably you haven't installed the Bonjour service.

Get Bonjour for Windows: Download Bonjour Print Services for Windows v2.0.2. Just install it.

  • 14
    This should be the selected answer
    – Sudar
    Aug 10, 2013 at 15:43
  • 3
    Silly, just to let others know: in my case my home router (Pirelli Centro Grande) is handling dhcp for my LAN. I never had ssh or network issues with Raspian nor any other Linux in my LAN until I upgraded to Raspian Jessie. This automatically installed dhcpd and avahi. I had to remove both, avahi-daemon and isc-dhcpd-server to avoid dhcp and name server conflicts with my router. Now my Raspberry is available by its name again.
    – user38336
    Jan 18, 2016 at 16:16
  • 4
    'insserv' isn't available on my raspbian... ?
    – oo_dev
    Oct 18, 2017 at 15:01
  • 6
    @copa017 Not here either on my Raspbian Lite at least, but just sudo apt-get install insserv. Otherwise follow the instructions above. Tested and worked for me!
    – Jonas
    Dec 26, 2017 at 19:53
  • 2
    $ sudo insserv avahi-daemon insserv: FATAL: service mountkernfs has to exists for service udev insserv: FATAL: service mountdevsubfs has to exists for service hwclock insserv: FATAL: service urandom has to exists for service networking insserv: FATAL: service udev is missed in the runlevels 2 3 4 5 to use service raspi-config insserv: exiting now! May 30, 2021 at 0:42

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