Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Windows know how to resolve mDNS queries?

When you install Bonjour for Windows you can resolve any ".local" mDNS name from anywhere in the system.

For example, you can "ping some_computer.local" and mDNSResponder.exe (Bonjour/mDNS Daemon) will respond.

However, mDNS operates on port 5353 so how does Windows know how to resolve these DNS queries?

Is mDNSResponder.exe hooking into the Windows DNS Resolver somehow?

like image 928
SofaKng Avatar asked Dec 28 '11 18:12

SofaKng


People also ask

Does Windows use mDNS?

Devices and services from Microsoft, Apple, Google, and Amazon all use mDNS in some capacity.

How does mDNS protocol work?

When an mDNS client needs to resolve a hostname, it sends an IP multicast query message that asks the host having that name to identify itself. That target machine then multicasts a message that includes its IP address. All machines in that subnet can then use that information to update their mDNS caches.

How does mDNS service discovery work?

Multicast DNS (mDNS) provides a naming service system that is easy to set up and maintain, for computers on a local link. All participating network devices on the same local link perform standard DNS functions, using multicast DNS rather than unicast, and do not need a unicast DNS server.

How do you fix mDNS?

- Disable mDNS (Apple Bonjour or avahi-daemon) service if you are not using it. Is the easiest and the most effective solution. - Configure your firewall to filter inbound connections to your server UDP/5353, and only allow the trusted network IPs/hosts that need to contact your mDNS service to access it.


1 Answers

Bonjour for Windows allows any software using the standard name resolution APIs to resolve mDNS names; it does so by registering a DLL (mdnsnsp.dll) as a namespace provider using WSCInstallNameSpace.

The corresponding code is included in the mDNSResponder source (in particular, look at the mdnsNSP and NSPTool components).

like image 99
SimonJ Avatar answered Oct 02 '22 05:10

SimonJ