Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to know if it's possible on a debian machine to automatically setup the hosts file of every other computer on the network.

I'd like to be able to connect to the machine using a host name instead of the IP (ssh user@hostname instead of ssh user@, but I don't want to change manually all the hosts files on the other computers on the network. Is there a way to do it automatically ?

Thanks !

share|improve this question
up vote 4 down vote accepted

You can setup a local DNS server and configure all your machines to use it. This way you don't need to edit hosts file on every machine whenever you add a new one or change its IP.

For automatically managing the configuration files, you can try configuration management software like puppet.

share|improve this answer
Will do, thanks ! – Ping Jan 16 '13 at 12:18

You better to configure a local DNS server and a DHCP server.

Using DHCP server you can even supply the NameServer name each client should use.

share|improve this answer

Your Answer


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.