Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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
    
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.