name resolution for small lan
I have a very small lan connect to comcast though a belkin router. I have the gateway and dns set to the router's ip address. This connects all the PC to the internet, and to each other. I have a few linux boxes on the lan.
I would like the linux boxes to be able to connect to each other by name, not just IP. I thought I could do that by editing the /etc/hosts files; but - to my surprice - that does not work. The first line in my /etc/resolv.conf is the address of the router. There is nothing in /etc/hosts.deny, or /etc/hosts.allow. I am very sure the hosts are spelled correctly, and there is no case conflict, and the IP addresses are correct. When I try to ping one the hosts by name I get the error: "ping: unknow host <i>hostname</i>." I can ping all the hosts by ip address. Can I use /etc/hosts? Or should I set up dns on my of my linux boxes. If I set up dns on a linux box, will that affect my ability to connect to the internet by my cable modem? |
Make sure your /etc/host.conf has the following entry:
order hosts,bind |
My /etc/host.conf file:
order hosts,bind multi on |
make sure you are running lwres
|
Thank you, I never heard of it until your post. Unfortunately, it didn't work. Here is what I did:
# aptitude install libnss-lwres # cd /etc/init.d/ # ./networking restart # ping hostname But I got the same error. |
Re: name resolution for small lan
Quote:
.. |
Well when name resolution breaks on a lan but it looks for WAN/Internet hostnames (well, FQDN actually) I found that lwres is the issue. Not only do you have to have the daemon running but in /etc/nsswitch you need this line:
hosts: files lwres dns Not just files dns, but files lwres dns --Kim |
It worked, thanks.
Also, the first line in my resolv.conf file is: nameserver 192.168.2.1. Sorry about any confusion. |
All times are GMT -5. The time now is 05:57 AM. |