Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

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?

share|improve this question
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? –  mathStudent May 31 '13 at 9:02
add comment

marked as duplicate by Mat, Anthon, jasonwryan, vonbrand, Chris Down May 31 '13 at 13:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 3 down vote accepted

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

share|improve this answer
add comment

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