LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux > 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
 
Thread Tools
Old 07-03-2003, 03:16 PM   #1
seven
LQ Newbie
 
Registered: Jul 2003
Posts: 1
Thanked: 0
Unhappy Ping a computer in LAN using hostname


[Log in to get rid of this advertisement]
Hi there :-)

I have a problem that has been bugging me for a while and I'd be greatful if someone could help me. I'm quite new to linux and networking so please be patient with me.

I have a small LAN at home using a router and a cabel modem to connect to the internet. The computers get their IPs and stuff from the router dynamically using the dhcp and I have no problems connecting to the internet.

The problem is that I can't ping the other computers in the LAN from my linux computer when I use hostnames. I get:
ping: unknown host aHostname.
I can ping the other computers without problem when I use IPs instead of hostnames. I can also ping myself using localhost and my own hostname. Also, when I ping from my windows XP computer using hostnames, all works fine so there has to be something wrong with my network configuration in linux (debian), but I don't know where.

I don't want to add the hostnames to the /etc/hosts since the IPs might change when I use dhcp. The address of the router is in the /etc/resolv.conf as nameserver, so I thought the hostnames should be resolved using the DNS of the router (NETGEAR MR314) or isnt't the router responsible for this?

I'd also like to know if I have to add anything about a domain in the configuration. My ISP is in the yetnet.ch domain, but I don't understand if my LAN is also a part of this domain or if it is only important to the cabel modem.

Thanks for any help.
seven is offline     Reply With Quote
Old 07-03-2003, 05:31 PM   #2
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 207
Thanked: 1
your router probably doesn't have a clue about the hostnames of each computers hostname. You might be able to set that up, but I doubt it.

Windows can ping by hostname because it uses netbios to send out that information.

You could setup a local dns/dhcp server, shut off your router's dhcp, and give the router a static route. This would solve your problem but be some work.
mrtwice is offline     Reply With Quote
Old 07-04-2003, 02:28 AM   #3
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280
Thanked: 0
you dont have to setup any extra servers for this, just edit /etc/hosts

here is my /etc/hosts file

Code:

127.0.0.1	decatur localhost
192.168.1.266   gigahurts.net


this works if the ips are static though.
Robert0380 is offline     Reply With Quote
Old 07-05-2003, 11:42 PM   #4
RottenMutt
Member
 
Registered: Jul 2003
Location: dfw
Distribution: Latest Fedora Release
Posts: 179
Thanked: 0
i have the same problem as the original poster posted...
only difference is that i'm running RH 9.0.
i'm able to share printers on my windows machine and files. It seems like linux just won't ask the router to resolve the names....

I'm a to linux, thanks for your help

best i can tell is maybe linux isn't configured to use a default gateway or a dhcp sever....

Last edited by RottenMutt; 07-06-2003 at 12:18 AM..
RottenMutt is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
can ping network computer, cannot ping google.com (help needed) ben_build#2.1.0 Linux - Wireless Networking 22 06-02-2006 04:11 AM
Any idea why this time I can not ping my LAN pc but can PING for ex. www.yahoo.com vakia Debian 5 09-28-2005 07:42 PM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 05:57 AM
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 12 09-21-2003 02:31 AM
Can ping by IP but not by hostname gillesdutertre Linux - Networking 8 09-01-2003 08:59 AM


All times are GMT -5. The time now is 11:44 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration