Solved

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

Posted on 2008-10-31
16
1,278 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remote Desktop Services in AWS 4 53
PoE Injector and switch 2 53
X.509 Cert Upload to Cisco WAP 6 58
Reasons for disabling SMB signing? 5 50
Resolve DNS query failed errors for Exchange
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
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…

759 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