[CentOS] How to make nodes in my local LAN see each other's names

Tue Nov 29 18:00:47 UTC 2011
Craig White <craig.white at ttiltd.com>

On Nov 29, 2011, at 9:14 AM, Timothy Madden wrote:

> Hello
> 
> Sorry for the (I guess) simple question, but:
> 
> I have 7 computers under one 8-port router (D-Link DIR-100, firmware 
> v1.13EU) in my network (actually in a sub-network) and they do not see 
> each other's host names.
> 
> The router has the 'DNS relay' option enabled, and all 7 computers use 
> the router as the DNS server, which in turn will forward DNS requests to 
> the ISP DNS server. That way I can understand that simple, plain, 
> default DNS is not enough for my boxes to see each-other's names.
> 
> Windows has a nice (or not) way to resolve the problem: CIFS (Samba) 
> server names are automatically included in the name resolving procedure. 
> I know I can do the same with my CentOS boxes if I install samba on each 
> of them and add 'wins' to the 'hosts: ' line in /etc/nsswitch.conf, but 
> somehow I think installing cifs on every node just to get my local 
> machine names to resolve properly to the IP addresses is not the right 
> way to solve my problem ...
> 
> What is the way to have all computers in my simple network know each 
> other by name ?
> 
> Is it possible to have the name resolving procedure used by the system 
> automatically recognize a new machine added to my network, when I try to 
> access it with right host name, like WINS can ?
> 
> Also, I hear Linux does not have, by default, a cache of resolved names 
> (like Windows does), and I find that to be a sad thing. Why should the 
> default be set so that I contact the ISP DNS server for each and every 
> web page I hit ?
> 
> Is there an easy way to install a caching name server on my each 
> machine, and make sure my system is using /that server/ to resolve names ?
----
just to clarify some things...

NETBIOS is a rather chatty (ie, noisy/traffic generating) for a local subnet. Yes, this can be a convenient way of being able to refer to a computer by its name and the price you pay for that convenience is a fair amount of broadcast traffic by all computers that support this protocol (Windows, Macintosh or Linux using NMBD).

NETBIOS does not in any way provide DNS services. It is relegated to the local subnet only and almost always what is designated as non-routed IP space (10.x.x.x, 172.16.x.x, 192.168.x.x)

UNIX/Linux has a reasonably simple method for maintaining DNS names in /etc/hosts where you can simply set them, ie
192.168.1.1 srv1 srv1.mydomain
192.168.1.2 srv2 srv2.mydomain
etc.
You can also do this on Windows systems - edit C:\Windows\System32\drivers\etc\hosts

If you want Dynamic DNS on your LAN, you are going to find that the typical home/SOHO routers are insufficient with short lease times, no memory storage for previously registered DHCP addresses and no ability to actually provide real DNS (other than forwarding to some other DNS server) and thus, no DDNS. Thus if you really want to have dynamic DNS on your local LAN, you would want to install bind and dhcp packages and configure them (not the easiest thing to do but not entirely difficult either).

Craig