I just updated my Pi0W's to stretch, from jessie, and now putty won't let me connect by name (e.g. [email protected]) 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 [email protected]
. 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 [email protected]
(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
).
-
Have you ACTUALLY tried this?
[email protected]
works perfectly on macOS and Linux -pi@computername
DOES NOT. See Zero-conf Commented Jun 28, 2018 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."– IngoCommented Jun 28, 2018 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 Commented Jun 28, 2018 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
[email protected]
on a network with DHCP server?– IngoCommented Jun 28, 2018 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.
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.– IngoCommented Jun 28, 2018 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.
-
-
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.– BrianCommented Jun 28, 2018 at 3:54
-
@Milliways: Yep, but as he had just upgraded, it seemed the most likely.– SeamusCommented Jun 28, 2018 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?– SeamusCommented Jun 28, 2018 at 13:42
-
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 [email protected]. 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.– BrianCommented Jun 28, 2018 at 14:34
send host-name = gethostname();
in/etc/dhcp/dhclient.conf
?