Link to home
Start Free TrialLog in
Avatar of BofADev
BofADev

asked on

Compare and contrast how Windows and Mac OS (Leopard) resolves a hostname on local network

I am a recent Mac convert and am having an issue accessing a device from Mac using hostname.  I've been reading a lot about this problem on the internet but the answers aren't really sinking in.  So lets start this discussion with a simple question.

For the purpose of this discussion when I refer to my "Local Network" that means my home network which consists of a router, a dsl modem, multiple pcs, a network attached storage device and a macbook all attached to the same router.

From a pc connected to my local network when I type ping localhostname (this is a host name of a device on my local network).  How does windows resolve the localhostname into an ip address?
ASKER CERTIFIED SOLUTION
Avatar of JohnGerhardt
JohnGerhardt
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of omarfarid
The system will either resolve it from the local hosts file (under C:\WINDOWS\system32\drivers\etc dir) or from dns servers (configured part of tcp/ip properties).
Avatar of BofADev
BofADev

ASKER

Thanks for the quick response.

I would agree with your answer since that is what I thought happened however, the following makes me think differently.
 
I verify there is nothing in hosts file (located at c:\windows\system32\drivers\etc\hosts) except for the localhost entry.
 
I flush dns by typing this in command prompt ipconfig /flushdns

Then I do a nslookup from a pc and it does not resolve the hostname to an ip.  However, when I do a ping from a pc it does resolve the ip and the ping is successful.  If nslookup fails what is ping doing to get the ip?

Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\Andy>nslookup nas200
Server:  dns.bna.bellsouth.net
Address:  205.152.150.23

*** dns.bna.bellsouth.net can't find nas200: Non-existent domain

C:\Users\Andy>ping nas200

Pinging nas200 [192.168.1.102] with 32 bytes of data:
Reply from 192.168.1.102: bytes=32 time=1ms TTL=64
Reply from 192.168.1.102: bytes=32 time=1ms TTL=64
Reply from 192.168.1.102: bytes=32 time=1ms TTL=64
Reply from 192.168.1.102: bytes=32 time=1ms TTL=64

Ping statistics for 192.168.1.102:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms

C:\Users\Andy>

 
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BofADev

ASKER

Does anyone know of a way to determine if it could be netbios or wins as omarfarid suggets?  The reason I am going through this excercise is I think it will be critical to the next part of my question concering how Mac OS does the same thing.
can you look at the file lmhosts in the same dir?
Avatar of BofADev

ASKER

Hi I looked at the lmhosts file and the only thing in there are about a page of comments.  Nothing is uncommented.
Avatar of BofADev

ASKER

Ok it is definately NETBIOS that make a ping possible by hostname on the local network.  I turned netbios off on my connection in windows and I couldn't ping the device...turn netbios back on and it works.

So the question now becomes is there a way to get netbios woring on the mac.  Essentially, what I want to do is be able to get the ip address of a device on my local network via hostname.  Currently from a mac I can only connect via ip address.
NetBIOS is a windows protocol..
so MAC wont do it natively... Have a look @
http://support.apple.com/kb/TA36629?viewlocale=en_US
But i suggest you create a new question for this in the MAC zone so you can get the attention of the experts there...

Why dont you just add a record in the hosts file..?
http://support.apple.com/kb/TA27291?viewlocale=en_US
You may run a dns server that can resolve for you hostnames to ips
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BofADev

ASKER

Can you tell me more about this option
"If you use DHCP then it can update DNS records on behalf of all autoconfigured hosts."
You need recent 3.x of DHCP server.
Avatar of BofADev

ASKER

I appreciate everyone's comments.  John and Omar helped me understand how windows and mac differ in their behavior which was the main point of this question.  Gheist provided a good overview of things to try if I would like to setup a DNS or WINS server.  I am splitting the answer/points 3 ways.  Also, I found some really good links over the weekend that does an excellent job of explaining in plain english the differences between file sharing in windows and mac.

http://discussions.apple.com/thread.jspa?threadID=1277379
Avatar of BofADev

ASKER

Thanks for walking me through the process.  It really helped me understand the reasons the solutions I have found elsewhere are correct.