LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-18-2005, 11:51 AM   #1
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Rep: Reputation: 46
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?
 
Old 10-18-2005, 12:01 PM   #2
zymurgist
Member
 
Registered: Jan 2003
Location: Long Island
Distribution: Redhat 8.0
Posts: 109

Rep: Reputation: 15
Make sure your /etc/host.conf has the following entry:
order hosts,bind
 
Old 10-18-2005, 12:38 PM   #3
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
My /etc/host.conf file:

order hosts,bind
multi on
 
Old 10-18-2005, 12:49 PM   #4
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
make sure you are running lwres
 
Old 10-18-2005, 03:30 PM   #5
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
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.
 
Old 10-18-2005, 03:32 PM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
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?

..
 
Old 10-18-2005, 03:36 PM   #7
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
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
 
Old 10-19-2005, 10:30 AM   #8
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
It worked, thanks.

Also, the first line in my resolv.conf file is: nameserver 192.168.2.1. Sorry about any confusion.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Resolution screen to small on knoppix burnt1ce85 Linux - Newbie 1 12-11-2004 11:48 AM
Enlarging small resolution pictures Boffy General 4 08-16-2004 04:52 PM
small resolution on laptop diskotek Linux - Newbie 2 01-05-2004 12:15 AM
Screen resolution is too small! Josnap Slackware 1 03-30-2003 11:36 PM
486 on a small lan bradut Linux - Networking 1 08-06-2002 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration