What Is mDNS (Multicast DNS)? How .local Addresses and Auto-Discovery Work

Why a printer or smart TV can find other devices by name alone, with no DNS server involved.

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.

How full DNS lookups work, for comparison

For the complete process behind resolving an ordinary internet domain name to an IP address, a dedicated look at how DNS lookups work is worth reading alongside this.

How it relates to smart-home protocols

Smart-home devices also rely on other wireless protocols like Zigbee and Z-Wave for device communication β€” different layers of the smart-home stack that are worth understanding separately from mDNS's role in discovery.

Frequently Asked Questions

What happens if mDNS isn't working?

Devices stop showing up automatically by name, which often means manually entering an IP address to register a printer or smart TV in an app or settings screen. A router's multicast settings or client/AP isolation feature are common culprits blocking mDNS traffic, so those are worth checking first.

Does mDNS work without an internet connection?

Yes β€” mDNS only operates within the local network, so devices on the same Wi-Fi or router can still find each other even with no internet connection at all.