I read this question

How to make a machine accessible from the LAN using its hostname

What is the simplest way to enable a LAN of Linux hosts to identify each other by hostname? Obviously each host will still require an IP address, but how do you make sure hosts can recognize eachother by hostname?

Is this possible without nmap, setting up a DHCP server, or installing avahi?

  • 1
    The hosts file option doesn't require any of that. You might be able to use netbios via SAMBA, but at that point, why not use avahi? – jordanm May 31 '13 at 2:48
  • Can you define what you mean by simplist? (Minimal characters typed to install? Out of a test with a significant amount of non-Linux users the solution with the most people to be able to implement the solution?). A solution is depending on it context, is that LAN connected to the internet or not? Simplest to implement, or to maintain? Again what are the criteria for judging that. – Anthon May 31 '13 at 2:55
  • The answer to your question, is the same as that other question. Use /etc/hosts or install a local dns server. – Johan May 31 '13 at 4:49
  • like, the URL embedded in my post? – T. Webster May 31 '13 at 9:02

You have to provide a way to resolve names. That means either i) populate /etc/hosts, ii) set the hostnames in your DNS server (which doesn't require you to install a DHCP server) or iii) use multicast DNS. So technically yes it is possible to set up name resolution without using nmap, installing a DHCP server or avahi (just insert the records into a DNS server or populate /etc/hosts).

The simplest solution is just to install avahi and libnss-mdns on all machines. Afterwards you should be able to access them via $hostname.local

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