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.

3
  • @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? Commented Sep 3, 2013 at 21:41
  • The first three (mDNS preferred). Commented Sep 3, 2013 at 22:04
  • You can simply use avahi-daemon on both computers. Then you can do ping <hostname>.local
    – user84207
    Commented Dec 25, 2020 at 6:21

1 Answer 1

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.

Not the answer you're looking for? Browse other questions tagged .