You are not logged in.

#1 2009-03-26 01:22:22

tjwallace
Member
Registered: 2009-03-07
Posts: 40
Website

Pinging computers on local network

Hi,
I am having problems pinging clients on my location network (192.168.0.x) by there host name.  Is there a tutorial or thinks I should check to get that working?

Thanks for the help!

Offline

#2 2009-03-26 02:17:35

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Pinging computers on local network

A bit more information about your current setup would be helpful...

How many hosts on the network?
What type of hosts (PC, Mac) and O/S (Win, Linux)
Your current IP configuration from one of the hosts on the network.

Offline

#3 2009-03-26 02:39:24

Pudge
Arch Linux f@h Team Member
Registered: 2006-01-23
Posts: 300

Re: Pinging computers on local network

If you can ping computers on your local network by IP address, but not by host name, then you need to populate your /etc/hosts/  file.

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1        localhost.localdomain    localhost

192.168.0.60        1stComputer.localdomain    1stComputer
192.168.0.61        mycomputer.localdomain    mycomputer
192.168.0.62        yourcmputer.localdomain    yourcomputer
192.168.0.63        Valhalla.localdomain            Valhalla
192.168.0.64        testbox.localdomain            testbox

# End of file

Check it out further with

man hosts

Pudge

Offline

#4 2009-03-26 17:26:49

tjwallace
Member
Registered: 2009-03-07
Posts: 40
Website

Re: Pinging computers on local network

fukawi2 wrote:

A bit more information about your current setup would be helpful...

How many hosts on the network?
What type of hosts (PC, Mac) and O/S (Win, Linux)
Your current IP configuration from one of the hosts on the network.

There are 4 other hosts on the network (all PC)
1. Ubuntu laptop - Wired
2. WinXP laptop - Wired
3. WinXP desktop - Wired
4. WinXP laptop - Wireless

Router @ 192.168.0.1
I have a saved DHCP @ 192.168.0.100
Everyone else is using DHCP on 192.168.0.101 and higher

Offline

#5 2009-03-26 17:28:04

tjwallace
Member
Registered: 2009-03-07
Posts: 40
Website

Re: Pinging computers on local network

Pudge wrote:

If you can ping computers on your local network by IP address, but not by host name, then you need to populate your /etc/hosts/  file.

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1        localhost.localdomain    localhost

192.168.0.60        1stComputer.localdomain    1stComputer
192.168.0.61        mycomputer.localdomain    mycomputer
192.168.0.62        yourcmputer.localdomain    yourcomputer
192.168.0.63        Valhalla.localdomain            Valhalla
192.168.0.64        testbox.localdomain            testbox

# End of file

Check it out further with

man hosts

Pudge

I thought it would do hostname lookup automatically, without having to populate /etc/hosts.  Also all the other hosts are using DHCP so their IP could change.

Offline

#6 2009-03-26 18:34:07

phildg
Member
Registered: 2006-03-10
Posts: 146

Re: Pinging computers on local network

Hostname lookup is done automatically, but the hostname of your other machines isn't published anywhere. The normal thing to do is run a DNS server on your local network and have your DHCP server notify the DNS server of new/expired leases. This isn't possible with most home routers.

You may be able to ping Windows computers from other Windows computers using host names, but there is a proprietary mechanism to broadcast hostname/ip pairs using NetBIOS I believe. I have little knowledge on how it works, but I have found it unreliable and unpredictable.

Offline

#7 2009-03-26 22:20:57

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Pinging computers on local network

phildg wrote:

You may be able to ping Windows computers from other Windows computers using host names, but there is a proprietary mechanism to broadcast hostname/ip pairs using NetBIOS I believe. I have little knowledge on how it works, but I have found it unreliable and unpredictable.

Correct (on all counts). Linux doesn't do the NetBIOS thing, so it can't see/use the Windows Hostnames without a DNS server or entries in the hosts file I'm afraid.

Offline

#8 2009-03-26 22:56:36

barjo
Member
Registered: 2006-02-20
Posts: 33

Re: Pinging computers on local network

install samba (in debian/ubuntu, install winbind), edit /etc/nsswitch.conf, add wins at the end of the line hosts, this should look something like that:
hosts : files dns wins

you don't need too start samba to ping windows box by name.

Offline

#9 2009-03-27 00:52:51

Pudge
Arch Linux f@h Team Member
Registered: 2006-01-23
Posts: 300

Re: Pinging computers on local network

tjwallace wrote:

I thought it would do hostname lookup automatically, without having to populate /etc/hosts.  Also all the other hosts are using DHCP so their IP could change.

I only use D-Link routers, so I can't speak for other routers.  With my D-Link I can set up the DHCP server on the LAN side to use a range of IP addresses for DHCP, say 192.168.0.2 to 192.168.0.100.  All DHCP leases will be set up in that range.  Then 192.168.0.101 to 192.168.0.254 can be used for static addresses.  The D-Link will serve both types of addresses simultaneously, DHCP and static.  You could set up the Windows boxes on the DHCP part and your Linux boxes in the static address area.

Or, you could do like I do.  I have static addresses on all my computers.  Six Arch Linux boxes, and two Windows XP boxes.  If you are going to network multiple computers, and some of them are Linux boxes, static addresses really save a lot of head aches.

Here is a tutorial I wrote for setting up ssh and sshfs on Arch Linux.  It may be of use to you.  I use the sshfs setup for Linux to Linux networking, and SAMBA for Linux to Windows networking.

Pudge

Offline

#10 2009-03-27 06:35:36

tjwallace
Member
Registered: 2009-03-07
Posts: 40
Website

Re: Pinging computers on local network

I installed Jaunty onto a virtual machine and tried pinging the host machine (tjwallace.local) and it found it fine.  Trying to ping the VM (jaunty.local) from the host did not work.  I checked the /etc/nsswitch.conf file on the VM and found the following:

hosts:    files mdns4_minimal [NOTFOUND=return] dns mdns4

I then search mdns in the Arch package repo and found nss-mdns. I installed it and added mdns4 to my own nsswitch.conf file.

I am now able to ping jaunty.local from my host machine!

Last edited by tjwallace (2009-03-27 06:36:14)

Offline

#11 2009-03-27 08:07:08

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Pinging computers on local network

Nice! There's one for a wiki article if you could spare 10 minutes wink

Offline

#12 2009-03-27 14:23:43

tjwallace
Member
Registered: 2009-03-07
Posts: 40
Website

Re: Pinging computers on local network

fukawi2 wrote:

Nice! There's one for a wiki article if you could spare 10 minutes wink

I just searched and it's actually already there: http://wiki.archlinux.org/index.php/Ava … resolution

Last edited by tjwallace (2009-03-27 14:25:23)

Offline

Board footer

Powered by FluxBB