I just updated my Pi0W's to stretch, from jessie, and now putty won't let me connect by name (e.g. pi@computername.local) like it used to. It does work as expected if I use the IP. But the odd thing is, I still have a jessie machine on the network, and I can connect to it using the above naming scheme (pi@computername works, as well). This is on my local, home network. Any thoughts?

  • 2
    How is the IP address for the Pi0W assigned? Is it manually set on the Pi or is it getting the IP via DHCP? Or something else? Also, what is the setting of send host-name = gethostname(); in /etc/dhcp/dhclient.conf? – hcheung Jun 27 '18 at 13:06
  • Both Pi (the Jessie one that responds to SSH pi@PiNameA.local, and the Stretch one that doesn't) get their IP addresses via DHCP. Are you asking if I have the "send host-name..." line? (I do, same as your example.) Or do you want to know what follows it ("request subnet-mask, broadcast-address...")? The only thing I've done to the Jessie Pi is install minidlna, and Samba. Other than that, it's vanilla. The Stretch one is vanilla. – Brian Jun 28 '18 at 4:04
  • if you actually "updated… to stretch, from jessie" using one of the unofficial tutorials (which are not officially supported by the Foundation) who knows - there were a number of significant changes to networking. If you try on a fresh install and have problems ask a new question. There are just too many unknowns to provide a meaningful comment. – Milliways Jun 28 '18 at 10:29
  • Okay, I misspoke. I didn't update; I put a fresh image on the card. And, now that I'm thinking about it, it was the lite image, if that makes a difference. – Brian Jun 28 '18 at 13:50

This "naming scheme" is due to something called mDNS. If you're using a Mac, it's built in as Bonjour; if you're on Windoze, it's either from MS' dodgy implementation of mDNS, or from iTunes that's been installed on Windoze. You can also install software on your RPi that will add mDNS - an app (strictly speaking a service) called avahi. Installing avahi should resolve your issue, and make your RPi responsive to a name such as raspberrypi.local.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install avahi-daemon 

And that's it. Let us know if you have any other issues, and we'll try to help.

| improve this answer | |
  • I am not sure mDNS is relevant to Zero-conf - NOTE there is NO NEED to install anything on Raspbian - Zero-conf as been included since 2015 – Milliways Jun 28 '18 at 0:03
  • Okay, I just checked one of the offending Pi, with dpkg -l avahi-daemon, and it's indicating that it's already installed. That is, I haven't installed it using your commands above; it's already there. But, installed is not running, so I checked that, as well, with systemctl is-active avahi-daemon.service, and it's showing as active. I would suspect that something was wrong with my putty file...but it connects as it always has to the Jessie Pi. – Brian Jun 28 '18 at 3:54
  • @Milliways: Yep, but as he had just upgraded, it seemed the most likely. – Seamus Jun 28 '18 at 13:32
  • @Brian: Couple of questions: 1. What type of host are you using (i.e. linux, windoze, mac) to make the SSH connection to your RPi, and 2. What does your DHCP server on your home network show for the stretch and jessie RPi's? By that I mean does the DHCP server recognize them by name or just by IP? – Seamus Jun 28 '18 at 13:42
  • 1
    Just for fun, I SSHed into each Pi, and from there was able to SSH by name into the other Pi using both user@name and user@name.local. That is to say, Jessie can SSH into Stretch, and vice versa. So why is the Windows PuTTY client choking on both naming conventions for Stretch, but not Jessie? Probably ought to be directed to the Windows client board, but I suppose it's of interest here (if it's reproducible), as well. – Brian Jun 28 '18 at 14:34

You tried to connect to "stretch" machines with pi@computername.local. This is the domain from mDNS with autoconfigured ip addresses. To "jessie" machines you connect with pi@computername. This is the naming scheme for static ip addresses or from a dhcp server with dyndns and search domains. By specification mDNS will never autoconfigure ip addresses if it find a dhcp server on the network. Try to connect to your "stretch" machines with pi@computername.

To clarify it: there is an important difference between pi@computername.local (this will address the local domain defined by RFC3927 without using DNS) and pi@computername (this will use name resolution through DNS or entries in /etc/hosts).

| improve this answer | |
  • Have you ACTUALLY tried this? pi@computername.local works perfectly on macOS and Linux - pi@computername DOES NOT. See Zero-conf – Milliways Jun 28 '18 at 1:35
  • 1
    @Milliways I ACTUALLY read RFC3927. It tells us unter 1.9.3: "If a host finds that an interface no longer has an operable routable addr available, the host MAY identify a usable IPv4 Link-Local addr (section 2) and assign that addr to the interface. Ways in which an operable routable addr might cease to be available on an interface include: * Removal of the addr from the interface through manual configuration * Expiration of the lease on the addr assigned through DHCP * Roaming of the host to a new network on which the addr is no longer operable." – Ingo Jun 28 '18 at 8:14
  • I spent most of my life as a Telecommunications planner, and NEVER found reading specifications a substitute for testing. The RFC is about DHCP and mentions Link-local address which have NOTHING to do with Zero-conf – Milliways Jun 28 '18 at 8:23
  • @Milliways Link-local address is part of Zero-conf. But that isn't the point. Have you tested to address a host with pi@computername.local on a network with DHCP server? – Ingo Jun 28 '18 at 8:59
  • 1
    @Milliways internet standards are defined by RFCs. You are right to encourage people to use DHCP but it cannot used with a link-local address at the same. This would mean that an interface has two ip addresses one from the DHCP server e.g. and one from the special block for link-local addresses and autoconfigured network name hostname.local. The domain .local is resevered for this and a DNS server must not serve it. I have never seen two ip addresses on an interface on linux running avahi and a dhcp client. – Ingo Jun 28 '18 at 10:13

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.