Solved

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

Posted on 2008-10-31
16
1,273 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 40

Assisted Solution

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

Author Comment

by:BofADev
Comment Utility
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
Comment Utility
can you look at the file lmhosts in the same dir?
0
 

Author Comment

by:BofADev
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 17

Expert Comment

by:JohnGerhardt
Comment Utility
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
Comment Utility
You may run a dns server that can resolve for you hostnames to ips
0
 
LVL 61

Assisted Solution

by:gheist
gheist earned 100 total points
Comment Utility
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
Comment Utility
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 61

Expert Comment

by:gheist
Comment Utility
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
You need recent 3.x of DHCP server.
0
 

Author Comment

by:BofADev
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
new to networking configuration 6 30
Need a cheap RFID setup 10 39
NSD FAIL 2 19
Domain join remote sites or not 3 25
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now