0

Forgive the noob question: I have a server that I would like to address by name from clients on the local network, i.e. instead of typing

ssh user@10.0.0.x

I would like to type

ssh user@servername

I don't really know what goes into this, apart from being fairly certain that I've seen this done without having to edit the /etc/hosts file on each client on the network. I have configured my router to assign the same IP every time the server boots up. Should there be another option on the router to do this? Or do I need to configure something on the server?

OS is Ubuntu Server 10.10.

2 Answers2

1

Best way to use multicast DNS. Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery.

Othre way:

  1. Install DNS server, create A record to servername and configure DNS to each server.
  2. Add record to "/etc/hosts":

    10.0.0.x server
    
  3. Use .ssh/config

    Host aliasname
       HostName 10.0.0.x
    
ooshro
  • 11,134
  • 1
  • 32
  • 31
0

As you don't want to touch all of your clients you will need to set up some sort of DNS system. Dnsmasq is probably the easiest to set up and configure for a small network.

You will need to find out from your router what your current DNS servers are and configure DNS masq to use them.

Then configure your router's DHCP server to tell the clients to use the dnsmasq server for their DNS.

Once you have done this you can add your server to the /etc/hosts file on the dnsmasq server and your clients should pick it up.

You can install dnsmasq with the command

sudo apt-get install dnsmasq

The manual can be found here.

user9517
  • 115,471
  • 20
  • 215
  • 297