Solved

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

Posted on 2008-10-31
16
1,276 Views
Last Modified: 2013-12-23
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?
0
Comment
Question by:BofADev
  • 7
  • 4
  • 3
  • +1
16 Comments
 
LVL 17

Accepted Solution

by:
JohnGerhardt earned 200 total points
ID: 22854152
1. Check Hosts file on the local machine
2. Check DNS cache on local machine
3. Query primary DNS server for answer
3. Query secondary DNS server for answer

Dont think there are any more steps that I have missed out...
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 22854327
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).
0
 

Author Comment

by:BofADev
ID: 22854442
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>

 
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 200 total points
ID: 22854486
I am not sure but it could be using netbios or wins
0
 

Author Comment

by:BofADev
ID: 22854500
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.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 22854534
can you look at the file lmhosts in the same dir?
0
 

Author Comment

by:BofADev
ID: 22855618
Hi I looked at the lmhosts file and the only thing in there are about a page of comments.  Nothing is uncommented.
0
 

Author Comment

by:BofADev
ID: 22855765
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.
0
 
LVL 17

Expert Comment

by:JohnGerhardt
ID: 22855984
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
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 22856144
You may run a dns server that can resolve for you hostnames to ips
0
 
LVL 62

Assisted Solution

by:gheist
gheist earned 100 total points
ID: 22867563
You can change DNS provider order in Windows advanced network settings (when you get explorer list with netcard connections choose advanced/advanced settings and set preferable network protocols and bindings.)

You can install winbind(d) from samba and integrate it into /etc/nsswitch.conf to make OSX understand MS names

You can configure your DNS server to accept updates from windows clients and get their DNS records right

If you use DHCP then it can update DNS records on behalf of all autoconfigured hosts.

If you have predominantly Windows then you can set up and use WINS server, which adds quick network browsing to windows, especially if you have multiple IP subnets or really changing IP addresses via DHCP. It can be done on Samba host too.

DNS is standard, WINS and other MS stuff is not, but read on WINS, since it adds functionality.
0
 

Author Comment

by:BofADev
ID: 22867849
Can you tell me more about this option
"If you use DHCP then it can update DNS records on behalf of all autoconfigured hosts."
0
 
LVL 62

Expert Comment

by:gheist
ID: 22867874
0
 
LVL 62

Expert Comment

by:gheist
ID: 22867880
You need recent 3.x of DHCP server.
0
 

Author Comment

by:BofADev
ID: 22868036
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
0
 

Author Closing Comment

by:BofADev
ID: 31512739
Thanks for walking me through the process.  It really helped me understand the reasons the solutions I have found elsewhere are correct.  
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Simultaneous work of Wi-Fi and LAN on Win10 laptop 4 58
Splitting network into several individual networks. 6 47
Blacked by spamhaus? 26 69
Price for Fiber 13 30
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question