Can SSH with IP but not host name?
52,429
You could try adding 10.1.10.129 noranetserver
to /etc/hosts, to make the computer you connect from aware of the server hostname.
There are other ways as well, as pointed out in the following questions: 1 and 2.
Related videos on Youtube
Author by
PopKernel
Updated on September 18, 2022Comments
-
PopKernel over 1 year
When I SSH directly to the server's IP address, it works. (ssh [email protected]) For reference, here is the resulting prompt:
michael@noranetserver:~$
However ssh-ing by name doesn't work like so:
ssh michael@noranetserver ssh: Could not resolve hostname noranetserver: nodename nor servname provided, or not known
Why would this be?
-
No Time about 10 yearsYou could try nslookup and see if the 'noranetserver' is in the names list.
nslookup noranetserver
if it is not that may be the reason. -
PopKernel about 10 yearsIs nslookup preinstalled on most UNIX-likes? Or must I download it?
-
No Time about 10 yearsYes it should be in by default
-
PopKernel about 10 yearsIt returned ** server can't find noranetserver: NXDOMAIN Does that mean anything?
-
No Time about 10 yearsSucky think about SSH: Using NAT (especially on port overload), and DHCP make it hard to SSH because of the constant changed, vs a home network where you can set stuff up how you want. :/ hope that answer below helped.
-
-
mikewhatever about 10 years