LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   name resolution for small lan (https://www.linuxquestions.org/questions/linux-networking-3/name-resolution-for-small-lan-374307/)

walterbyrd 10-18-2005 11:51 AM

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?

zymurgist 10-18-2005 12:01 PM

Make sure your /etc/host.conf has the following entry:
order hosts,bind

walterbyrd 10-18-2005 12:38 PM

My /etc/host.conf file:

order hosts,bind
multi on

KimVette 10-18-2005 12:49 PM

make sure you are running lwres

walterbyrd 10-18-2005 03:30 PM

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.

nx5000 10-18-2005 03:32 PM

Re: name resolution for small lan
 
Quote:

Originally posted by walterbyrd

The first line in my /etc/resolv.conf is the address of the router.

You mean nameserver x.y.z.t ? or x.y.z.t only?

..

KimVette 10-18-2005 03:36 PM

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

walterbyrd 10-19-2005 10:30 AM

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.