0

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.

user1424739
  • 255
  • 3
  • 11
  • @grawity, your answers on http://superuser.com/questions/185678/connect-to-linux-by-name-rather-than-ip 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 03 '13 at 21:41
  • The first three (mDNS preferred). – u1686_grawity Sep 03 '13 at 22:04
  • You can simply use avahi-daemon on both computers. Then you can do `ping .local` – user84207 Dec 25 '20 at 06:21

1 Answers1

0

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.

Daniel J.
  • 298
  • 1
  • 7