Standard mDNS service on Windows

前端 未结 6 854
無奈伤痛
無奈伤痛 2021-02-02 10:31

Does Windows (some modern flavour) have an mDNS server installed and/or running by default? If so then how does one tell it, preferably dynamically, to start/stop advertising a

相关标签:
6条回答
  • 2021-02-02 10:44

    Last time I needed one, Apple's Bonjour Print Services for Windows was the most convenient mDNS client for Windows I could find. Only 5MB.

    0 讨论(0)
  • 2021-02-02 10:54

    Have also successfully used C++/WinRT for dnssd discovery directly from C++ now. It appears from our perspective to be quicker and more reliable to query services and will let you easily install a watcher to get notifications when devices arrive etc. Of course, this is limited to versions of Windows 10 with support for C++/WinRT, which starts with 10.0.17134.0 (Windows 10, version 1803).

    One caveat: We've noticed that it does not provide, nor recognise, a FQDN (trailing dot). So for a device that Bonjour OR Avahi would give an address of mydevice.local., Windows instead gives mydevice.local. Attempting to ping mydevice.local. under Windows 10 (1809) fails.

    0 讨论(0)
  • 2021-02-02 10:55

    The short answer is to support both Avahi and Bonjour. You'll need Bonjour support to run on OSX anyway, and if a Windows user has installed iTunes they'll already be running it.

    As a fallback for Windows users not running iTunes, you can compile Avahi as a library for Windows (with a bit of effort) and bundle it. This is a non-trivial bit of packaging, but the alternative is requiring your Windows users to install iTunes in order to use your application.

    0 讨论(0)
  • 2021-02-02 10:56

    No, Microsoft doesn't directly support Multicast-DNS.

    However, there appear to be several 3rd-party alternatives:

    • http://bens.me.uk/2013/multicast-dns-and-development-virtual-machines

    • http://en.wikipedia.org/wiki/Bonjour_%28software%29

    • http://www.icir.org/gregor/tools/autoconf-protocols.html

    • http://www.zeroconf.org/

      ... and ...

    • http://blogs.technet.com/b/networking/archive/2008/04/01/how-to-benefit-from-link-local-multicast-name-resolution.aspx

    0 讨论(0)
  • 2021-02-02 10:57

    Starting with Windows 10, Microsoft made strides towards a native Windows implementation of mDNS and DNS-SD.

    While earlier iterations have been limited to UWP apps, a general Win32 API has been exposed from at least SDK version 10.0.18362.0 (1903/19H1, May 2019).

    Note: This implementation is currently confirmed working only for 64bit build targets, there is an open issue preventing compilation for 32bit targets.

    Outdated note from a previous version of this answer:

    Early iterations resulted in mDNS network flooding:

    Windows 10, in its default configuration, will spam its local networks by responding to all mDNS requests with null response packets.

    This issue was fixed in Windows 10 1511 (10586) and above

    0 讨论(0)
  • 2021-02-02 10:57

    Windows 10 supports natively mDNS/Zeroconf, but only for modern APIs, not for Win32 applications. If you have such an application, a third party service is required.

    Source: https://social.technet.microsoft.com/Forums/en-US/8a0346de-2296-4f46-bc36-ff3fb13e283b/builtin-mdnsdnssd-zeroconf-support-in-windows-10

    0 讨论(0)
提交回复
热议问题