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 Answers
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
.
Update:
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
).

- 42,107
- 20
- 85
- 197
-
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 01: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 08: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 08: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 08:59 -
Yes All my networks use DHCP. If you had read How to set up networking/WiFi you will see I try and encourage Pi users to use DHCP. Zero-conf works on ANY network segment - with the possible exception of M$ non-standard implementations - which I don't have. – Milliways Jun 28 '18 at 09:29
-
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.
192.186.1.10
and one from the special block169.254.0.0/16
for link-local addresses and autoconfigured network namehostname.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 runningavahi
and a dhcp client. – Ingo Jun 28 '18 at 10:13 -
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.

- 21,900
- 3
- 33
- 70
-
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 00: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 03: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
-
@Seamus: I am connecting to the various Pi's from a Windows 10 machine, using PuTTY 0.66. Just updated PuTTY to 0.70, 64-bit; same thing. IP addresses are not static. The DHCP server shows the correct names. The following works: pi@JessiePi.local & pi@JessiePi. And these do not: pi@StretchPi.local & pi@StretchPi. In the case of the failures, the message is: Unable to open connection to StretchPI.local gethostbyname: unknown error – Brian Jun 28 '18 at 14:09
-
1Just 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
send host-name = gethostname();
in/etc/dhcp/dhclient.conf
? – hcheung Jun 27 '18 at 13:06The 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 04:04