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

5th August 2008, 04:23 PM
|
|
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?
|

5th August 2008, 07:56 PM
|
 |
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.
|

5th August 2008, 08:27 PM
|
|
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.
|

7th August 2008, 03:28 AM
|
|
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
|

7th August 2008, 03:35 AM
|
 |
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 ... :)
|

7th August 2008, 03:41 AM
|
|
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?
|

7th August 2008, 03:47 AM
|
 |
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 ... :)
|

7th August 2008, 03:53 AM
|
|
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)
|

7th August 2008, 04:08 AM
|
 |
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 ... :)
|

7th August 2008, 04:57 AM
|
|
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?
|

7th August 2008, 05:14 AM
|
 |
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 ... :)
|

7th August 2008, 08:16 AM
|
|
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:
and the line that now reads:
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.
|

7th August 2008, 03:24 PM
|
|
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 13:08 (Saturday, 25-05-2013)
|
|
 |
 |
 |
 |
|
|