You are not logged in.
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
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.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
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
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
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
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
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.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
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
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
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
Nice! There's one for a wiki article if you could spare 10 minutes
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Nice! There's one for a wiki article if you could spare 10 minutes
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