I have recently replaced a router at home. The old one was D-Link DIR-300, the new one is Keenetic Lite. There are two computers at home, let's call them desktop
and laptop
.
The problem is, before I changed the router I was able to connect e.g. from laptop
to desktop
like that:
ssh user@desktop
and it worked just fine; now when I try that, I get
ssh: Could not resolve hostname desktop: Name or service not known
which apparently means that ssh doesn't know what desktop
is anymore.
The computer still seems to be visible from the local network, when I run nmap -sP 192.168.1.*
, IP addresses of both computers are there. Furthermore, I don't think the issue is with ssh
itself: when I set up port 22 forwarding on router, I was able to ssh
into both computers using their external IP addresses. Using local IP addresses leads to port 22: connection refused
, though.
Here are my questions:
- How the hostname was resolved in the first place? When I did
ssh user@desktop
, how did the program find out to which IP should it connect? - How do I fix my setup so that it is able to do that again?
- Why am I unable to connect via
ssh
using local IP addresses?