Multicast DNS (mDNS) is a protocol that performs DNS-style name resolution on a local link by sending queries to a multicast address instead of a configured server. Specified in RFC 6762, it lets devices answer for their own names in the reserved .local domain, so printers, speakers and laptops can find each other without any administrator, zone file or DNS resolver.
Within DNS as a whole, mDNS reuses the standard DNS message format and record types, but replaces the hierarchical, server-based lookup with a cooperative, peer-to-peer model limited to one network segment. It is the naming layer beneath zero-configuration networking, most often paired with DNS-based service discovery.
How multicast DNS resolves names on a local link
Multicast DNS resolves a name by multicasting the question to every host on the link and letting the owner of that name reply. A client that wants the address of printer.local sends a query to 224.0.0.251 for IPv4 or ff02::fb for IPv6, always on UDP port 5353. Every mDNS responder receives the packet, and only the device that holds the name answers.
Responses are normally multicast back to the whole group, which allows other hosts to fill their caches passively and avoid repeating the same question. A querier can set the unicast-response bit when it only needs a direct reply, for example right after joining the network. Because packets use a link-local scope, routers do not forward them, which keeps traffic confined to one broadcast domain.
The following table lists the core protocol constants that every implementation shares.
| Parameter | Value | Purpose |
|---|---|---|
| IPv4 multicast group | 224.0.0.251 | Destination for IPv4 queries and replies |
| IPv6 multicast group | ff02::fb | Destination for IPv6 queries and replies |
| UDP port | 5353 | Separates mDNS from unicast DNS on port 53 |
| Reserved domain | .local | Names resolved only by multicast |
| IP TTL of packets | 255 | Lets receivers reject off-link packets |
| Typical record TTL | 120 s or 4,500 s | Short for host records, long for other records |
Probing, announcing and conflict resolution
Before a device uses a name, it must prove that no other host already owns it, because mDNS has no central authority to assign names. This happens in a strict start-up sequence defined by the specification, and it is the main reason mDNS works without configuration yet still produces unique names on the link.
- Probing: the host sends three queries for its intended name about 250 ms apart and listens for any answer.
- Tie-breaking: if two hosts probe the same name at once, a lexicographic comparison of their proposed records decides the winner.
- Renaming: the losing host picks a new name, commonly by appending a number such as
printer-2.local. - Announcing: the winner multicasts unsolicited responses with the cache-flush bit set so peers replace stale data.
- Goodbye: on clean shutdown the host sends its records with a TTL of zero so caches drop them immediately.
Ongoing efficiency depends on known-answer suppression: a querier lists the answers it already holds, and responders stay silent when those answers are still fresh. Combined with randomized delays of 20-120 ms before replying to shared records, this keeps multicast traffic modest even on links with dozens of devices.
Multicast DNS compared with unicast DNS
Multicast DNS and conventional unicast DNS share message syntax and record types but differ in almost every operational respect. The comparison below shows why mDNS suits small, unmanaged networks while ordinary DNS remains the backbone of internet naming.
| Aspect | Unicast DNS | Multicast DNS |
|---|---|---|
| Who answers | Authoritative and recursive servers | The device that owns the name |
| Namespace | Global hierarchy under the root | Flat names under .local |
| Scope | Entire internet | One link or broadcast domain |
| Configuration | Zone files, delegation, registrar | None required |
| Transport | UDP and TCP port 53, DoH, DoT | UDP port 5353 multicast |
| Uniqueness | Guaranteed by delegation | Achieved by probing |
| Security options | DNSSEC, encrypted transports | Essentially none in practice |
Related link-local protocols exist as well. LLMNR, defined by Microsoft for Windows, solves a similar problem on port 5355 but has been deprecated in favor of mDNS in recent Windows releases. NetBIOS name service is older still and relies on broadcast rather than multicast.
Service discovery and typical deployments
In practice, multicast DNS is rarely used alone; it is the transport for DNS-based service discovery (DNS-SD), specified in RFC 6763. DNS-SD uses PTR, SRV and TXT records to advertise what a device offers, so a client can browse for every printer or media receiver instead of knowing a host name in advance.
The next table shows how the three record types work together when a client browses for a service.
| Record | Example owner name | What it provides |
|---|---|---|
| PTR | _ipp._tcp.local | List of service instances of one type |
| SRV | Office Printer._ipp._tcp.local | Target host name and port |
| TXT | Office Printer._ipp._tcp.local | Key-value metadata such as model or paper size |
| A or AAAA | office-printer.local | IPv4 or IPv6 address of the host |
Major implementations include Apple Bonjour, the open-source Avahi daemon on Linux and the native mDNS stack in Windows and Android. Typical consumers are network printing, screen casting, smart-home hubs, music streaming between rooms and developer tools that publish a test server to colleagues on the same network.
Limitations, security risks and common problems
The convenience of mDNS comes from trusting every host on the link, and that trust is also its main weakness. Any device can answer for any name, so an attacker on the same segment can spoof responses and redirect traffic. Announcements also leak device names and services, which matters on guest and public Wi-Fi.
Operational problems usually stem from the link-local boundary or from misconfigured equipment. The table below maps frequent symptoms to causes and fixes.
| Symptom | Likely cause | Remedy |
|---|---|---|
| Devices invisible across VLANs | Multicast does not cross routers | Use an mDNS reflector or gateway |
| Discovery fails on Wi-Fi only | Client isolation or multicast filtering | Adjust access point multicast settings |
| Name keeps changing to name-2 | Duplicate host or a sleep proxy conflict | Remove the duplicate or rename manually |
| Corporate .local names break | Internal unicast zone uses .local | Move the internal zone to another suffix |
| Excess multicast traffic | Many chatty devices on one segment | Segment the network and filter by service |
A frequent design mistake is using .local for an internal unicast DNS zone. Clients then route those lookups to mDNS, producing slow or failed resolution. The safer choice is a dedicated internal suffix such as home.arpa for residential networks or a subdomain of a registered domain.
The idea in brief
Normally a computer finds another computer by asking a directory service, much like calling an operator for a phone number. Multicast DNS removes the operator. A device simply asks the whole room, “Who is office-printer?”, and the printer itself answers with its address.
Because everyone hears the answer, other devices remember it too. The approach only works inside one local network, and it assumes the people in the room are honest. The key point is that mDNS lets devices name and find each other with no setup at all.
A practical scenario
A small architecture office with twelve employees buys a network printer and a wireless display for its meeting room. No one on staff manages a DNS server. When the printer powers on, it probes for office-printer.local, finds the name free and announces it, along with an IPP print service record. Laptops running macOS and Windows see the printer in their print dialogs within seconds.
Later, the office splits its network into a staff VLAN and a guest VLAN, and the printer disappears from staff laptops because it sits on the other segment. The contractor enables an mDNS gateway on the router that forwards only printer and display services between the two VLANs. Discovery works again without exposing every device to guests, and no one has to type an IP address.