Ubuntu – Can SSH with IP but not host name


When I SSH directly to the server's IP address, it works. (ssh michael@ For reference, here is the resulting prompt:


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 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