How to access a Mac OS X server (machinename.local) from Windows?

1

2

If you turn on Web Sharing in Mac OS X, you can hit your local server with http://machinename.local/ instead of just your local IP address like http://192.168.1.101/. That's very convenient to me; I no longer have to remember IP addresses or worry about them changing.

This works great for me from other Apple devices connected to my network, e.g. iPhones and iPads. However, I can't seem to hit my server this way from a Windows machine. I was able to hit it fine with the IP address http://192.168.1.101/, but not as http://machinename.local/. I also tried just http://machinename/, but that didn't work either.

Does anyone know how I can hit the server from Windows by its machine name rather than the IP address?

Aseem Kishore

Posted 2011-03-29T23:24:18.317

Reputation: 146

Answers

3

Have you tried installing Bonjour for windows? That should let hostname.local names work.

afrazier

Posted 2011-03-29T23:24:18.317

Reputation: 21 316

Hmm, interesting -- thanks for the tip! I wasn't aware this would do it. Is there any way to achieve this without installing software on the machine though, just out of curiosity? – Aseem Kishore – 2011-03-30T00:46:49.980

1Yes, this has worked very well in my experience. That package is the only way I know of to accomplish this. – Matt B. – 2011-03-30T02:21:12.447

1@Aseem Kishore - yes, you can do this without bonjour. The process is called DNS. You can also achieve the same effect by adding entries to your hosts file – skub – 2011-03-30T02:30:46.793

3

I see from your Question and your comment on some of the answers that you'd prefer a way to do this without doing anything on the Windows boxes.

Does anyone know if web browsers on Windows can hit the personal web sharing on other Windows boxes based on their NetBIOS Name Service / WINS names (that is, the names you'd use when mapping a remote SMB share to a drive letter -- like "\SERVERNAME\SHARENAME\")?

I ask because Macs can participate in NetBIOS Name Service and even register with WINS servers, but it might not be activated until you turn on Windows-style SMB file sharing:

  1. Go to the "Sharing" pane of System Preferences.
  2. Check the "File Sharing" checkbox.
  3. Hit the "Options..." button.
  4. Check the "Share files and folders using SMB (Windows)" checkbox.
  5. Now go to the "Network" pane of System Preferences.
  6. Select your usual network interface and hit "Advanced..."
  7. Click on the "WINS" tab.
  8. Pick a Windows-style hostname and workgroup for your Mac
  9. Optionally specify a WINS server to use (if your site already has a WINS server, they probably give this information out via DHCP already).

One last helpful note: Starting in Vista, Microsoft put something Bonjour-like into Windows, called Link-Local Multicast Name Resolution (LLMNR). Unfortunately, it's not interoperable with Bonjour, and most Windows users are still on XP anyway. I don't know of any LLMNR implementations for Mac OS X.

The Wikipedia article on Zero Configuration Networking (i.e. IETF ZeroConf, etc.) provides a helpful overview of different technologies and their current status.

Spiff

Posted 2011-03-29T23:24:18.317

Reputation: 84 656

Awesome! Thanks for the tip. I'll try it out next time I have a Windows machine nearby. – Aseem Kishore – 2011-03-31T06:34:33.467

Re question in second paragraph: On most systems (Windows, Linux, OS X), name resolution is implemented at system level. When a program tries to resolve a name using getaddrinfo() or gethostbyname(), it works with any protocol that is enabled: DNS, NBNS, Bonjour... I have used both \\dns-name.tld\share and http://nbns-name/ many times. – user1686 – 2011-03-31T20:10:39.417

0

Add the machine's name to your local hosts file. In Windows 7:

  1. Click the Start button and then click into the Search box in the menu.
  2. Enter "C:\Windows\System32\drivers\etc" without the quotes.
  3. Hit Enter on the keyboard.
  4. When the window opens, ouble-click on the hosts file.
  5. Choose Notepad to open the file.
  6. Manually add your entry to the file.
  7. Save.

Do this once for each Windows box on the LAN, and you'll be able to use the name instead of the IP from then on.

This solution will fail if the IP address changes.

goblinbox

Posted 2011-03-29T23:24:18.317

Reputation: 2 414

Thanks, but I was aware of hosts and was hoping for a better solution. Whenever I'm on a friend's computer or network I don't want to have to mess with hosts files, mine or theirs. – Aseem Kishore – 2011-03-29T23:54:16.743

You want to reach these machines across the Internet, then, not just in your own LAN? If so, please update the question because that scenario has a completely different solution. :-) – goblinbox – 2011-03-29T23:56:18.560

Nope, not on the internet. I sometimes develop at home, sometimes at a friend's house, sometimes at another friend's house. The IP address changes each time. I don't have a Windows box so sometimes borrow my girlfriend's laptop for a quick test in IE when I'm at home, or my friend's laptop at his home, etc. – Aseem Kishore – 2011-03-29T23:59:26.133

If http://machinename.local is on one private network and you're on another, then you would have to cross the internet to reach it. You would have to enable NAT in your gateway device/router, and have DNS hosted as well. Are you talking about connecting over a VPN, maybe?

– goblinbox – 2011-03-30T00:02:11.270

No, sorry for still not being clear. =P My machine is a laptop; there's no crossing network boundaries. – Aseem Kishore – 2011-03-30T00:23:07.557

Oh, I'm sorry too, I'm just not understanding you today! Okay, so you said you use your friend's laptop at his home, yes? So YOU'RE on HIS network, and you're using his laptop over his LAN to connect to your Mac laptop for testing purposes? Or again, maybe at your girlfriend's house? Do I understand you now? :-) – goblinbox – 2011-03-30T00:28:38.517

Yep! Put another way: I'd like to be able to hit my laptop (over HTTP) from other devices, regardless of where I am (i.e. what network I'm on), assuming those other devices are on the same network. Hope this helps. =) – Aseem Kishore – 2011-03-30T00:44:00.463

Hmm. Well, since I don't know how OSX does its internal name resolution, I don't know how to make Windows listen to it. What you want may not be possible. Hopefully some Mac geeks will drop by! – goblinbox – 2011-03-30T01:14:47.760

0

Another option you might consider is Dynamic DNS. There are even free dynamic DNS services out there. Note that in order for it to work the network you are on would have to have an internet connection to interrogate the dynamic DNS server you are using.

Flummoxed

Posted 2011-03-29T23:24:18.317

Reputation: 86

Care with the DynDNS guys — they will spam the crap out of you for years :( – Alan H. – 2012-05-24T06:55:48.207