What is mDNS (Multicast DNS)?
Normally resolving a domain name to an IP address means asking some DNS server out on the internet, but a printer, smart TV, or speaker on a home or office network rarely has a dedicated DNS server to ask. mDNS lets devices on that local network announce 'this is my name' via multicast and answer queries the same way, resolving names without any DNS server at all.
The .local domain
Devices found via mDNS use the special .local top-level domain to distinguish themselves from regular internet domains β a printer announcing itself as 'MyPrinter.local' signals to other devices on the network that this name should be resolved via mDNS, not ordinary DNS. .local is reserved so it never gets routed outside the local network, avoiding any collision with real internet domains.
How it works: multicast query and response
mDNS runs over UDP port 5353 using the IPv4 multicast address 224.0.0.251 (ff02::fb on IPv6). Every mDNS-capable device on the network listens to that multicast group, and only the device matching a given name query responds with its own IP address; the querying device caches that answer and refreshes it periodically.
DNS-SD: discovering services, not just names
DNS-SD (DNS Service Discovery), paired with mDNS, goes beyond 'where is this named device' to 'is there any device offering this kind of service.' Querying for something like '_ipp._tcp.local' gets a response from every printer on the network, each reporting its name, port, and details β which is how an app or OS can show a list of available printers without anyone knowing an exact name or IP.
Real-world uses
AirPlay device discovery, screen mirroring, automatic wireless printer detection, and smart-home device setup all rely on mDNS behind the scenes to find nearby devices automatically. Apple's implementation is called Bonjour; the Linux-world equivalent is Avahi.
Key implementations: Bonjour, Avahi, Zeroconf
Software that implements the mDNS/DNS-SD standards is collectively known as Zeroconf β networking that works with zero configuration. Apple built this in as Bonjour across macOS and iOS, Avahi provides the same role in the Linux world, and Windows often ends up running a Bonjour service too whenever iTunes or certain printer drivers get installed.
Security considerations
mDNS has no authentication built in β any device on the same network can respond, including an untrusted one spoofing name information. On public Wi-Fi (a cafe or airport), that means your device's name and services could be exposed to strangers on the same network; mDNS is also designed to stay within a local network by default and doesn't cross a router without a dedicated mDNS reflector.