Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 5th August 2008, 04:23 PM
hyperplus Offline
Registered User
 
Join Date: May 2007
Posts: 41
ping other computers by hostname

I am having problems to ping <other computers> from my FC9 pc.

What else should I check?

In my router using DHCP to dynamically assing IP, I see all computers connected with the hostname next to the assigned IP.

If I ping <x.x.x.x>, I get reply from all computers... but if I ping <hostname> I can only ping myself.

Any ideas?
Reply With Quote
  #2  
Old 5th August 2008, 07:56 PM
oneofmany's Avatar
oneofmany Offline
Registered User
 
Join Date: Aug 2006
Posts: 226
if you're talking about windows computers, they use wins resolution/netbios to lookup machine names and retrieve a specific ip address for them.

the only way you can do the same on your linux box is for all the machines to use a local dns server or to modify the /etc/hosts file and add ip/name pairs for the machines in question. note, however, that the hosts file isn't great for dhcp assigned ip addresses since they are subject to change.

that said, if you're part of an nt domain/active directory, you can join that domain/active directory if you've setup samba correctly, and should then be able to resolve machine names correctly.
Reply With Quote
  #3  
Old 5th August 2008, 08:27 PM
bbfuller Offline
Registered User
 
Join Date: Jun 2005
Location: UK
Posts: 4,345
Hello hyperplus

There is a third way of doing it. If you run a samba server on each of your Linux machines then one modification to the /etc/nsswitch.conf file will also enable name lookup in the same way that Windows does it.

Not recommended for large networks, but at home, if you are using dhcp for ip addresses from a router, it's a lot easier than trying to remember ip addresses.

Post back if you'd like to talk about that.
Reply With Quote
  #4  
Old 7th August 2008, 03:28 AM
hyperplus Offline
Registered User
 
Join Date: May 2007
Posts: 41
bbfuller, that's exactly what I am looking for. I have been trying to learn and figure out how to get it done, but no luck.

My setup is:
3 pcs + 1 router (all wireless)

Router:
I see my 3 PCs with DHCP IP assign and hostname

PCs:
1 Linux FC (file server)
1 Linux FC (my personal)
1 Vista 32bit (another personal)

If you have a link about how to setup this let me know.

I switch the /etc/nsswitch.conf file:
hosts: dns files

but no luck....
[root@hypernb etc]# ping linuxbox
ping: unknown host linuxbox

(same box)
[root@hypernb etc]# ping 192.168.0.193
PING 192.168.0.193 (192.168.0.193) 56(84) bytes of data.
64 bytes from 192.168.0.193: icmp_seq=1 ttl=64 time=0.606 ms
64 bytes from 192.168.0.193: icmp_seq=2 ttl=64 time=0.565 ms
Reply With Quote
  #5  
Old 7th August 2008, 03:35 AM
Seve's Avatar
Seve Offline
Retired Community Manager
 
Join Date: Oct 2004
Location: The GTA, Ontario, Canada
Age: 54
Posts: 12,376
Hello:
In your Linux install. (To resolve the DNS issue that you are having )
Edit your /etc/hosts file
and add
for e.g.
192.168.0.193 nameofcomputer

nameofcomputer 192.168.0.193

This will allow you to ping etc. the other computers on your network using their hostname instead of their ip address.

Seve
__________________
Registered Linux User: #384977
.................................................. ............
See the Links below for more Help and those much wanted extras ... :)
Reply With Quote
  #6  
Old 7th August 2008, 03:41 AM
hyperplus Offline
Registered User
 
Join Date: May 2007
Posts: 41
So seems is pretty complicated to have my linuxbox on a dynamic ip and resolve to hostname...

or not?
Reply With Quote
  #7  
Old 7th August 2008, 03:47 AM
Seve's Avatar
Seve Offline
Retired Community Manager
 
Join Date: Oct 2004
Location: The GTA, Ontario, Canada
Age: 54
Posts: 12,376
Hello:
No, not really, keep in mind that something/some convention has to do your DNS resolution if you want to use host names instead of the IP address ?
Not sure why the rest of your network PC's would have anything other than a static IP ?

Seve
__________________
Registered Linux User: #384977
.................................................. ............
See the Links below for more Help and those much wanted extras ... :)
Reply With Quote
  #8  
Old 7th August 2008, 03:53 AM
hyperplus Offline
Registered User
 
Join Date: May 2007
Posts: 41
I could have static IP on them.

But I was trying to learn how to set up the dynamic ip to hostname resolution in Linux. I usually like try new things, and I thought it will be easier to keep the PCs using dynamic IP. (now it seems totally the contrary)
Reply With Quote
  #9  
Old 7th August 2008, 04:08 AM
Seve's Avatar
Seve Offline
Retired Community Manager
 
Join Date: Oct 2004
Location: The GTA, Ontario, Canada
Age: 54
Posts: 12,376
Hello:
It doesn't matter if it is Linux / Windows or whatever. You have to have some "agent" doing your DNS resolution if you wish to communicate with other computers on your network by host name.
The same as your internet experience .... do you ping google.com or do you find out google.com's IP address and then ping that?

Seve
__________________
Registered Linux User: #384977
.................................................. ............
See the Links below for more Help and those much wanted extras ... :)
Reply With Quote
  #10  
Old 7th August 2008, 04:57 AM
hyperplus Offline
Registered User
 
Join Date: May 2007
Posts: 41
So I added..
[root@hypernb hyperplus]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost localhost
192.168.0.111 hypernb.localdomain hypernb
::1 localhost6.localdomain6 localhost6

I am using NetworkManager (in case makes a difference)....

So if I use DHCP, I get an IP assigned.. not what I wanted now. But if I use MANUAL, I get the correct IP and says connected, but no Internet.. (or at least FireFox can connect)

Any ideas?
Reply With Quote
  #11  
Old 7th August 2008, 05:14 AM
Seve's Avatar
Seve Offline
Retired Community Manager
 
Join Date: Oct 2004
Location: The GTA, Ontario, Canada
Age: 54
Posts: 12,376
Hello:
Any ideas ....?

The answer was given to you before, however, you chose not to follow up on it ??

The convention is
PHP Code:
IPaddress             hostname 
So if 192.168.0.111 is on your network and is a computer named hypernb,
then
PHP Code:
192.168.0.111         hypernb
hypernb                   192.168.0.111 
is added to your /etc/hosts file
then restart your network or reboot and you should be good to go.

If I have misunderstood something that you are trying to accomplish, then let me/us know and we can go forward from there.

Seve
__________________
Registered Linux User: #384977
.................................................. ............
See the Links below for more Help and those much wanted extras ... :)
Reply With Quote
  #12  
Old 7th August 2008, 08:16 AM
bbfuller Offline
Registered User
 
Join Date: Jun 2005
Location: UK
Posts: 4,345
Hello hyperplus

As I mentioned above, I use my router to supply dynamic ip addresses to the machines on my network. Once you get above three or so machines, keeping hosts files synchronised can be a chore.

If you are in a mixed Windows/Linux situation then there is a simple way of getting name resolution using the Windows method.

It will not work though usless you have a Samba Server set up and running on each of your Linux boxes.

In my circumstances where I am sharing between any of my machines that is a given.

As long as Samba is allowed thoough the firewall, edit the file:

Code:
/etc/nsswitch.conf
and the line that now reads:

Code:
hosts: files dns
amend to read

Code:
hosts: files wins dns
If the host line is more complicated than that, and I've seen it so in F8, it is important that the 'wins' entry appears in the order before 'dns'

Hope that helps, post back if you have any questions.
Reply With Quote
  #13  
Old 7th August 2008, 03:24 PM
hyperplus Offline
Registered User
 
Join Date: May 2007
Posts: 41
Thanks all for you help. I will try it tonight and post results.

Concept wise is easy to follow, but understanding the actual "make it work" is not that straight until you get it working one time.

[update]
Again thanks for your help, and I also found another way to achieve a similar behavior...

My router supports the reservations of ip... so even if my machine is requesting an ip, the router will return the same ip always... kind of emulating "static ip" and is very easy to configure.

Later on I will look to play with WINS services.

Last edited by hyperplus; 10th August 2008 at 03:52 AM.
Reply With Quote
Reply

Tags
computers, hostname, ping

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ping using hostname era_pk Servers & Networking 3 20th November 2008 09:10 PM
Please help!!! Computers can't ping. Hunkah Servers & Networking 6 27th November 2005 11:18 AM
cannot ping by hostname projkt4 Servers & Networking 11 4th September 2005 08:48 PM
Fedora Core 3 Hostname Error (Windows cannot ping 'hostname') 3K Tech Servers & Networking 1 3rd January 2005 03:24 AM
Can't ping local computers tron_thomas Servers & Networking 2 18th July 2004 05:00 AM


Current GMT-time: 05:00 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat