LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 07-03-2003, 02:16 PM   #1
seven
LQ Newbie
 
Registered: Jul 2003
Posts: 1

Rep: Reputation: 0
Unhappy Ping a computer in LAN using hostname


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.
 
Old 07-03-2003, 04:31 PM   #2
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Rep: Reputation: 31
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.
 
Old 07-04-2003, 01:28 AM   #3
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
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.
 
Old 07-05-2003, 10:42 PM   #4
RottenMutt
Member
 
Registered: Jul 2003
Location: dfw
Distribution: Latest Fedora Release
Posts: 186

Rep: Reputation: 30
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-05-2003 at 11:18 PM.
 
  


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
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 13 03-17-2011 02:47 AM
can ping network computer, cannot ping google.com (help needed) ben_build#2.1.0 Linux - Wireless Networking 23 11-07-2010 12:55 PM
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 06: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 04:57 AM
Can ping by IP but not by hostname gillesdutertre Linux - Networking 8 09-01-2003 07:59 AM


All times are GMT -5. The time now is 08:38 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration