17

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?

5
  • You could try nslookup and see if the 'noranetserver' is in the names list. nslookup noranetserver if it is not that may be the reason.
    – No Time
    May 16, 2014 at 17:00
  • Is nslookup preinstalled on most UNIX-likes? Or must I download it?
    – PopKernel
    May 16, 2014 at 17:02
  • Yes it should be in by default
    – No Time
    May 16, 2014 at 17:04
  • It returned ** server can't find noranetserver: NXDOMAIN Does that mean anything?
    – PopKernel
    May 16, 2014 at 17:39
  • Sucky 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.
    – No Time
    May 16, 2014 at 20:07

2 Answers 2

10

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.

2
  • 1
    Is there a more universal way to do this? I was hoping to using the computer's hostname for a variety of other things on the network. I can't hold on to the static IP indefinitely, I just convinced my superior to let me use one as a stopgap measure.
    – PopKernel
    May 16, 2014 at 18:37
  • 1
    Sure, there are other ways to make the server advertise its hostname. Please refer to the following questions: 1 and 2. May 16, 2014 at 18:47
0

Try avahi-daemon package, it just work as a service.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .