I have several Ubuntu computers connected (with wires) by Linksys E1000. Currently, I edit /etc/hosts on each machine to map the hostnames of all the machines and their corresponding IP addresses so that I can access each computer by hostname. But this requires editing of each /etc/hosts files.

I'm wondering if there is a way to somehow setup the network in a way that I don't have to edit all the /etc/hosts files whenever I add a new machine to the network. Thanks.

  • @grawity, your answers on superuser.com/questions/185678/… may not be all applicable to my question. Would you please let me which of the solutions you mentioned (mDNS, NetBIOS, DNS, free DNS subdomains) are relevant to my questions? – user1424739 Sep 3 '13 at 21:41
  • The first three (mDNS preferred). – grawity Sep 3 '13 at 22:04

a - Configure one of your computers to act as a DNS forwarder and use its hosts file as the master b - Set up your clients to use the router as the DNS server and set some static DNS entries in the router (only valid if the router allows static DNS entries). You could use a Microtik router in between your LAN and your gateway for this, its less than 40 USD and has lots of features. c - Replicate the hosts file periodically between computers by using the cron daemon by means of scp or rsync d - Setup a full DNS server at one of the computers.

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