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


  Search this Thread
Old 07-03-2003, 02:16 PM   #1
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 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
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
LQ 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:	decatur localhost

this works if the ips are static though.
Old 07-05-2003, 10:42 PM   #4
Registered: Jul 2003
Location: dfw
Distribution: Latest Fedora Release
Posts: 195

Rep: Reputation: 31
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.


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 15 03-30-2015 02:39 PM
can ping network computer, cannot ping (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. 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 > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:00 PM.

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