22

I've got some Linux servers on my home network that I access via "hostname.local", however when using a Windows machine they can't seem to resolve this unless I go via IP address.

How do I make it so my windows machine can resolve hostname.local addresses? I know how to edit C:\Windows\System32\drivers\etc\hosts but surely there's got to be some automatic way to make Windows just find these machines?

Jorge Castro
  • 1,092
  • 4
  • 13
  • 29
  • How do you make this work on the Linux machines? (Because you want to use the same method on the Windows machines.) Do you configure it on each machine? Or do you have a local DNS server that resolves them for you? – David Schwartz Oct 23 '12 at 18:42
  • @DavidSchwartz Ubuntu comes with avahi out of the box so they can resolve each other just fine with no configuration from me. – Jorge Castro Oct 23 '12 at 18:45

3 Answers3

39

Usually .local names are resolved using mDNS – the Linux servers probably run Avahi, OS X has it built in, and for Windows there is Apple's own Bonjour.

2020-12-14: Updated for Windows 10 built-in mDNS support.

Windows 10 (version 1511 or later)

Windows 10 handles both hostname and hostname.local identically: it simultaneously tries LLMNR for the bare hostname, NetBIOS for the bare hostname, and (optionally) mDNS for hostname.local. This mDNS support is not restricted to 'Modern' apps anymore.

To activate the mDNS support, set the EnableMulticast registry value to 1:

reg add "HKLM\Software\Policies\Microsoft\Windows NT\DNSClient" /v EnableMulticast /t REG_DWORD /d 1 /f

Windows XP—8.x

An older version of Bonjour (v2.0) is included within Bonjour Print Services. It is also available as a Chocolatey package.

The latest version (v3.x) is not available as an independent download, but is installed as part of iTunes (and a few other applications). It is possible to use an archive manager (like 7-Zip or WinRAR) to extract Bonjour64.msi from the iTunes installer.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • 1
    Don't even need to reboot after installing the msi! – gak Dec 31 '12 at 23:15
  • latest version now is 3.0.10 – user528025 Jan 24 '13 at 11:45
  • 3
    I'm not going to update the answer for minor releases. You can extract the latest version from iTunes.msi by using `msiexec /a iTunes.msi TARGETPATH=iTunes.out`. – u1686_grawity Jan 24 '13 at 12:36
  • 5
    Installer is an exe now but you can extract it with WinRAR. – Snow Blind Sep 14 '13 at 21:33
  • 2
    You can also extract it from the exe installer using 7zip, etc. – Kevin Horn Sep 05 '14 at 03:11
  • It seems to be available as a standalone package here: https://chocolatey.org/packages/bonjour But that's the Bonjour Print Services. So I'm guessing this allows resolution of names more than just printers as stated on the page https://support.apple.com/kb/DL999?locale=en_GB – CMCDragonkai Feb 02 '17 at 06:18
  • I just installed Bonjour Print Services because I wanted my MacBook Air to be able to connect to my Windows PC as `.local` and vice-versa, and it works a charm, so I can vouch for that approach. – Andrea Oct 07 '17 at 15:06
  • In the latest version of Windows 10, Bonjour conflicts with the built-in mDNS resolver (which unfortunately is only available for modern apps). You first have to disable the built-in mDNS resolver with a registry entry. – Kevin Keane Jun 10 '18 at 05:31
9

As @Kevin Keane points out here (and in the comments section above), Windows 10 now clobbers mDNS port 5353 with a service that only works for modern Windows apps. So to let Bonjour back onto the port, the windows mDNS service must be quashed via the registry edit described in the link above.

In Windows 10 versions other than Home instead of the registry edit, the group policy editor can be used:

  • launch gpedit.msc
  • Navigate to Computer Configuration > Administrative Templates > Network > DNS Client
  • Enable the "Turn off Multicast Name Resolution" policy.

I didn't have to reboot.

Caveat, I already had both iTunes and Bonjour Print Services installed. Simply uninstalling Bonjour Print Services and reinstalling didn't work -- I had to go into add-remove programs, uninstall both Bonjour and Bonjour Print Services, then reinstall Bonjour Print Services, before pinging .local addresses started working again (virtualbox host-only linux guest with avahi-daemon running). I think this is because my "Bonjour Service" service was tied to Bonjour, not Bonjour Print Services, and it wasn't re-registering itself.

taur
  • 3
  • 2
deargle
  • 191
  • 1
  • 4
  • 1
    This worked for me on my Windows 10 box. I uninstalled Bonjour and upgraded my iTunes (it was time for a regular update) and the .local domains started working. I did not have to reboot. – Michaelkay Jan 09 '19 at 14:08
  • Disabling this is no longer necessary either; current Windows 10 versions have it off by default, but if you actually _enable_ it, they'll offer mDNS-based .local name resolution through the standard system functions without any third-party software. – u1686_grawity Jul 16 '19 at 10:33
  • @grawity On the latest version of Window Pro for Workstations, without Apple's mDNS resolver, I don't see it working with either Enabled or Disabled for that setting. The same `.local` name lookup works fine from Linux. – Rag Aug 13 '19 at 03:08
  • I have a DNS server in my home network. Before enabling this policy, my Windows 10 PC would occasionally be unable to resolve hostnames of Linux boxes. Now it seems to work as expected. – berndbausch Jan 26 '23 at 01:02
1

Install bonjour

The answers by @deargle and @user1686 are good, however I found modifying the registry to be unnecessary (Windows 10.0.19041.1415)

Download and install the bonjour package from apple to activate mDNS. No registry changes or reboot required

Note: If you have iTunes or Skype installed, you may already have bonjour present.

spuder
  • 9,854
  • 4
  • 42
  • 57