Ubuntu – Can SSH with IP but not host name

lanopensshserverssh

When I SSH directly to the server's IP address, it works. (ssh michael@10.1.10.129) 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?

Best Answer

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 Question