Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-18-2005, 11:51 AM
|
#1
|
Member
Registered: Apr 2004
Posts: 739
Rep:
|
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?
|
|
|
10-18-2005, 12:01 PM
|
#2
|
Member
Registered: Jan 2003
Location: Long Island
Distribution: Redhat 8.0
Posts: 109
Rep:
|
Make sure your /etc/host.conf has the following entry:
order hosts,bind
|
|
|
10-18-2005, 12:38 PM
|
#3
|
Member
Registered: Apr 2004
Posts: 739
Original Poster
Rep:
|
My /etc/host.conf file:
order hosts,bind
multi on
|
|
|
10-18-2005, 12:49 PM
|
#4
|
Senior Member
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794
Rep:
|
make sure you are running lwres
|
|
|
10-18-2005, 03:30 PM
|
#5
|
Member
Registered: Apr 2004
Posts: 739
Original Poster
Rep:
|
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.
|
|
|
10-18-2005, 03:32 PM
|
#6
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
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?
..
|
|
|
10-18-2005, 03:36 PM
|
#7
|
Senior Member
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794
Rep:
|
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
|
|
|
10-19-2005, 10:30 AM
|
#8
|
Member
Registered: Apr 2004
Posts: 739
Original Poster
Rep:
|
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 01:34 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|