Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 31st, 2008, 02:40 PM
johnnybeem johnnybeem is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 51 johnnybeem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 5 m 7 sec
Reputation Power: 8
Can't ping hostnames, only IPs

Trying to transition all my machines over from XP to Ubuntu, but I'm running into the same problem on every Ubuntu machine...

Internet works fine, and I can get to places like google.com by name. But when I try to ping hostnames on my home network from Ubuntu, the ping says "ping: unknown host <HOST>". If I ping IPs on the local network (e.g. ping 192.168.1.1), this goes through fine...

This also happens the other way around (pinging Ubuntu machines from other machines). Can't ping hostnames, only IPs.

Any idea what's wrong??

Reply With Quote
  #2  
Old May 31st, 2008, 06:01 PM
punkboii punkboii is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 407 punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 3 h 9 m 8 sec
Reputation Power: 24
Quote:
Originally Posted by johnnybeem
Trying to transition all my machines over from XP to Ubuntu, but I'm running into the same problem on every Ubuntu machine...

Internet works fine, and I can get to places like google.com by name. But when I try to ping hostnames on my home network from Ubuntu, the ping says "ping: unknown host <HOST>". If I ping IPs on the local network (e.g. ping 192.168.1.1), this goes through fine...

This also happens the other way around (pinging Ubuntu machines from other machines). Can't ping hostnames, only IPs.

Any idea what's wrong??


you might have to add all the IP's into DNS, I don't think unix works the same as windows in regards to DNS, I think that Windows broadcasts all the names around the network, but Im not sure if *nix does.

Try adding them to DNS and see what happens

should work

Reply With Quote
  #3  
Old May 31st, 2008, 07:11 PM
fishtoprecords's Avatar
fishtoprecords fishtoprecords is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Sep 2007
Location: outside Washington DC
Posts: 2,642 fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)  Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Weeks 4 Days 23 h 21 m 56 sec
Reputation Power: 3682
Quote:
Originally Posted by johnnybeem
This also happens the other way around (pinging Ubuntu machines from other machines). Can't ping hostnames, only IPs.


Pretty clearly you don't have proper host name resolution.
on windows, use nslookup in a shell.
on real OS, use dig in a shell.

Find out why you can't resolve the names, fix that.

Reply With Quote
  #4  
Old June 1st, 2008, 10:22 AM
johnnybeem johnnybeem is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 51 johnnybeem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 5 m 7 sec
Reputation Power: 8
alright, well I did some google-ing and got it working almost how I want it...

I installed some avahi, mdns, zeroconf packages (forget which ones) and now can ping from Windows <--> Ubuntu by pinging HOSTNAME.local

Still can not ping actual hostnames (e.g. ping HOSTNAME)... However, strange thing is I started a Samba server on one Ubuntu computer and now from Windows I can "ping HOSTNAME". Could *not* do that before I started Samba.

On Ubuntu, I still need to ping everything with .local

Does anyone know if it's possible to ping without requiring the .local extension?? There must be a way

Reply With Quote
  #5  
Old June 1st, 2008, 09:24 PM
fishtoprecords's Avatar
fishtoprecords fishtoprecords is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Sep 2007
Location: outside Washington DC
Posts: 2,642 fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)fishtoprecords User rank is General 41st Grade (Above 100000 Reputation Level)  Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2568392 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Weeks 4 Days 23 h 21 m 56 sec
Reputation Power: 3682
I'm not exactly sure I understand the problem you are describing, but if you have luck with :

ping foo.local

but

ping foo

fails, then you need to set your "default search domain'

In Debian/Ubuntu, you can add the line:
domain mydomain.com
in your /etc/resolve.conf

Not sure what the equivalent is in Windows
Comments on this post
Edvallie agrees: right-on

Reply With Quote
  #6  
Old November 7th, 2008, 04:48 PM
linosi linosi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: amsterdam
Posts: 1 linosi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 53 sec
Reputation Power: 0
a possible solution

Quote:
Originally Posted by fishtoprecords
I'm not exactly sure I understand the problem you are describing, but if you have luck with :

ping foo.local

but

ping foo

fails, then you need to set your "default search domain'

In Debian/Ubuntu, you can add the line:
domain mydomain.com
in your /etc/resolve.conf

Not sure what the equivalent is in Windows


In linux and windows there are host files
in linux /etc/hosts in windows \windows\system32\drivers\etc\hosts + lmhost in those files you add
entries like ip address hostname ( it's kind of an alternative
to setting up a dns) in windows you tell inthe network setting
( the advanced setting to use the host file.

When you ping the hostname of a computer the right
ip address replies the same goes for linux\

good luck

linosi

Reply With Quote
  #7  
Old November 17th, 2008, 11:38 AM
Lagniappe Lagniappe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 39 Lagniappe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 32 m 28 sec
Reputation Power: 5
Windows also added netbios names which can be resolved by lmhosts, wins server or name query broadcast messages ... which helps any windows computer on the local network be able to find another by name without the help of dns servers, etc.

Reply With Quote
  #8  
Old November 22nd, 2008, 07:28 AM
IAARep-DLE IAARep-DLE is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: Philadelphia,PA
Posts: 1 IAARep-DLE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 46 sec
Reputation Power: 0
Arrow A possible name problem solution.

If your local network is small, you could do the following. Copy a single file /etc/hosts file to each of the machines on your network. This file maps
computer names to IP addresses.
This method becomes little unwieldy if you have a lot of machines on the network, if so then I suggest writing a shell script to automate this process a little bit, using the rcp command, or even better the rsync command.
Another option is that you could run a local name server and have all of the
local machines first try to resolve the ip addresses on the local DNS first, and then use the network DNS provider if there is no name to IP matching.
This way you only have one file to update and transfer one file.

Reply With Quote
  #9  
Old May 17th, 2011, 02:18 PM
m_drunk m_drunk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 2 m_drunk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 33 sec
Reputation Power: 0
Try this little trick....

before you all get too carried away.

when winbind is installed, it's always nice to add "wins" to the hosts: line in /etc/nsswitch.conf.

Code:
hosts:          files dns mdns wins


This will allow ordinary TCP/IP programs to resolve hostnames with netbios, so you can, for instance, do "ping <hostname>" instead of "ping 192.168.1.xxx". Of course, ping isn't all that wonderful, but it's a lot easer to do "ftp hostname" or "ssh hostname" or browse to "http://hostname" than using raw IP's for the local machines (assuming of course they are running the given service and the forewall on the target machine allows access to the right ports).

Reply With Quote
  #10  
Old May 18th, 2011, 03:40 AM
punkboii punkboii is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 407 punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 3 h 9 m 8 sec
Reputation Power: 24
Well done - you've dug up a 4 year old thread....

Quote:
Originally Posted by m_drunk
before you all get too carried away.

when winbind is installed, it's always nice to add "wins" to the hosts: line in /etc/nsswitch.conf.

Code:
hosts:          files dns mdns wins


This will allow ordinary TCP/IP programs to resolve hostnames with netbios, so you can, for instance, do "ping <hostname>" instead of "ping 192.168.1.xxx". Of course, ping isn't all that wonderful, but it's a lot easer to do "ftp hostname" or "ssh hostname" or browse to "http://hostname" than using raw IP's for the local machines (assuming of course they are running the given service and the forewall on the target machine allows access to the right ports).

Reply With Quote
  #11  
Old May 18th, 2011, 11:52 AM
m_drunk m_drunk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 2 m_drunk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 33 sec
Reputation Power: 0
Quote:
Originally Posted by punkboii
Well done - you've dug up a 4 year old thread....


Yeah well....think Google cares how old it is? Top spot in Google with no answer. And while everything above is right, it's not how the problem is generally solved.

Reply With Quote
  #12  
Old May 19th, 2011, 03:01 AM
punkboii punkboii is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 407 punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level)punkboii User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 3 h 9 m 8 sec
Reputation Power: 24
Can't really say fairer than that...

Quote:
Originally Posted by m_drunk
Yeah well....think Google cares how old it is? Top spot in Google with no answer. And while everything above is right, it's not how the problem is generally solved.

Reply With Quote
  #13  
Old May 19th, 2011, 06:38 AM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
Yeah, but any question to which the suggested answer is, "let's add WINS ..." is just a wrong question!!! <troll/>
__________________
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Can't ping hostnames, only IPs

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap