Click to See Complete Forum and Search --> : Why can windows users ping by host name??
bgunn
01-28-2003, 05:20 AM
Hi All
I am running RH8 on an otherwise windows network. I have noticed that all of the windows computers can ping other computers on the network using just the host name (rather than the IP address). If I try doing the same thing, I just get a message saying host not found. The only way I can get around this is by adding host names to '/etc/hosts'.
Now I know for a fact that there is no 'hosts' files at play on the windows machines, and yet they seem to magically know what host name matches which IP address. I assume they must be using a local DNS (not sure if this is a correct assumption?). If so how can I found out what the DNS server they are using is? and how to I set up my Linux box to use it too?
Regards, Ben
root.veg
01-28-2003, 10:49 AM
Strange. I use ping as provided by Debian 3.0r1, and it lets me use host names fine, so I don't think it's a general all-distro problem. I know not much about networking, but this presents me with two general possibilities:
1) You're using some other version of ping
2) You haven't got DNS working properly
Can't tell which of these is more likely, but that's probably down to my own ignorance ;)
bwkaz
01-28-2003, 11:10 AM
Are you absolutely sure you're pinging the hostname, or could it be the SMB "computer name"?
If it's the computer name, then the machines are very likely using WINS to resolve it, not DNS. I don't know if there's a WINS client for Linux (check freshmeat), but if so, that would probably help.
There is actually a hosts file on WinNT/2k/XP, in %winnt%\system32\drivers\etc\hosts. But the majority of the time, it's either empty or trivial, and AFAIK it's never dynamic.
Gaston
01-28-2003, 12:09 PM
Not logged onto my linux box right now so can't be
100% sure for this, least this works on Solaris
but linux does some networking a bit differently.
You can create /etc/resolv.conf if one doesn't exist.
Do ls -al /etc/resolv.conf to find if the file exists
If not, then, as root:
touch /etc/resolv.conf
chmod 644 /etc/resolv.conf
The format of the /etc/resolv.conf file:
domain yourdomain.com
nameserver ipaddress here
nameserver ipaddress here
For example, your companyname's linusrules.com
and has DNS servers 177.20.221.23 and 166.143.20.1,
then you'd do:
domain linusrules.com
nameserver 177.20.221.23
nameserver 166.143.20.1
You also might need to add an entry in to /etc/nsswitch.conf
file where it reads "hosts", after that it reads files, add word
dns after that.
(this once again might be a Solaris specific)
Save the file(s) and reboot.
See if you now can ping hostname in your company network.
I have the same problems. Neither my RH8 or Windows machines can ping each other by hostname at all. It will ping fine with IP. Both RH8 and Windows machines are using DHCP client from the same Novell server. All the neccessary lines are in the resolve.conf file. If I manually add the hostname of the Windows machine in the hosts file in the RH8 machine then I could ping by name on the RH8.