1. Ports
  2. Port 5353

Port 5353 carries Multicast DNS (mDNS) traffic. Every time a device on your local network asks "who is printer.local?" and gets an answer without a DNS server, that question travels through port 5353. Every time your laptop discovers a printer, your phone finds a Chromecast, or your smart thermostat announces itself to HomeKit, port 5353 is the messenger.

This is the port that made zero-configuration networking possible. Before mDNS, connecting devices on a local network required either manual configuration or infrastructure. After mDNS, devices could simply introduce themselves.

What mDNS Actually Does

Traditional DNS works by asking a centralized server: "What's the IP address for google.com?" The server knows, and it answers. This works beautifully for the global Internet, where hierarchy and authority make sense.

But what about your living room? What about a conference room where two laptops need to share files? What about a printer that just showed up on the network?

mDNS inverts the model. Instead of asking a server, a device sends its question to everyone on the local network at once using a special multicast address: 224.0.0.251 for IPv4, or FF02::FB for IPv6.1 The question goes out to UDP port 5353, and any device that knows the answer responds, also via multicast to port 5353.

When your Mac asks "who is MyPrinter.local?", it's not asking a server. It's asking the room. And the printer answers.

The Mechanism

The elegance is in the details:

  1. The .local domain: Any hostname ending in ".local." is special. It belongs to no one and everyone. The IETF reserved it specifically for link-local naming.2 When your system sees a .local address, it knows to use mDNS instead of traditional DNS.

  2. The multicast address: 224.0.0.251 sits in a special range (224.0.0.0 to 224.0.0.255) that routers never forward.3 This traffic is confined to your local network by design. Your neighbor's printer discovery stays on their network, not yours.

  3. The response pattern: When a device responds to a query, it responds via multicast too, so every device on the network learns the answer. Ask once, teach everyone. This is how devices build a shared understanding of who's on the network without constantly repeating questions.

  4. Conflict resolution: What if two devices try to claim the same name? mDNS handles it. When a device joins the network, it probes to see if anyone else has claimed its name. If there's a conflict, one device backs off and picks a new name (often by appending a number).

The Story Behind the Protocol

In the late 1990s, Stuart Cheshire was a researcher at Stanford watching something absurd happen every day. PhD students in the Computer Science department were transferring files to Macs just so they could print them, because they couldn't figure out how to print directly from their Linux machines over IP.4

The Mac had AppleTalk, a protocol suite that made networking feel effortless. You plugged in a Mac, and it just appeared on the network. Printers announced themselves. File shares materialized. No configuration required. But AppleTalk was proprietary, aging, and Apple was about to kill it with the transition to Mac OS X.

Cheshire saw the future, and in that future, networking was about to get harder again. So he started an email discussion board to work on the problem. Apple noticed, and in January 1998, they hired him to solve it.5

The solution took time. mDNS was first proposed in the IETF in 2000 by Bill Woodcock and Bill Manning, but it took thirteen years of refinement before Stuart Cheshire and Marc Krochmal published RFC 6762 in February 2013.6 Apple shipped the first implementation in Mac OS X 10.2 in August 2002 under the name "Rendezvous" (later renamed to "Bonjour" after a trademark dispute with TIBCO).7

What Cheshire built wasn't just a replacement for AppleTalk's Name Binding Protocol. It was a philosophy: networks should work without humans configuring them. Devices should introduce themselves. Discovery should be automatic. The network should feel like a room where everyone knows each other's names.

DNS-SD: The Partner Protocol

mDNS tells you who is on the network. DNS-Based Service Discovery (DNS-SD), defined in RFC 6763, tells you what they can do.8

When you browse for printers on your Mac, you're not just asking "who's here?" You're asking "who here can print?" DNS-SD uses special DNS records to advertise services:

  • PTR records list what services are available (like "_ipp._tcp.local" for printers)
  • SRV records point to the specific host and port providing the service
  • TXT records carry additional metadata about the service

Together, mDNS and DNS-SD are the foundation for:

  • AirPrint: Your iPhone discovering printers9
  • AirPlay: Your Mac finding your Apple TV
  • Chromecast: Your phone discovering casting targets
  • HomeKit: Your smart home devices announcing themselves to your iPhone10
  • Spotify Connect: Your app finding speakers
  • Home Assistant: Your automation hub discovering devices11

Today, just about every network printer from just about every printer vendor supports Bonjour, and ships with it enabled by default.12 That's Stuart Cheshire's legacy: a world where printers just work.

Security Considerations

mDNS was designed for trusted local networks. It has the security properties of a room where everyone can hear everyone. This creates real risks:

Information Disclosure: Anyone on your local network can enumerate every mDNS-enabled device and service.13 They can discover your hostname, your operating system version, and what services you're running. In a coffee shop, that's everyone on the WiFi.

DDoS Amplification: Attackers can spoof mDNS queries with a victim's IP address, causing devices to flood the victim with responses. A 46-byte query can generate responses 4 to 10 times larger.14 In 2023, a coordinated attack exploited misconfigured mDNS implementations on Canon printers, HP servers, and Avahi installations to cripple critical infrastructure.15

Name Spoofing: Without authentication, any device can claim any name. An attacker could announce themselves as "printer.local" and intercept print jobs, or claim to be a legitimate service and capture credentials.

The Unicast Bug: Some mDNS implementations incorrectly respond to queries from outside the local network, exposing internal network structure to remote attackers.16

Mitigations:

  • Block UDP port 5353 at your network perimeter17
  • Use network segmentation to isolate IoT devices
  • Deploy IDS/IPS systems that monitor for anomalous mDNS traffic
  • Disable mDNS on devices that don't need it

mDNS trusts the local network. Make sure your local network deserves that trust.

PortProtocolRelationship
53DNSThe traditional unicast DNS that mDNS replaces for local names
67/68DHCPAssigns IP addresses; mDNS works even when DHCP is unavailable
137-139NetBIOSWindows' older approach to local name resolution
5354LLMNRMicrosoft's Link-Local Multicast Name Resolution, a similar concept
1900SSDPUniversal Plug and Play's discovery mechanism

The Deeper Truth

Before mDNS, networks felt like bureaucracies. You needed addresses, configurations, servers, administrators. The network was infrastructure you had to build before you could use it.

mDNS made the network feel like a room. Walk in, and you can hear who's there. Announce yourself, and others hear you. No registration desk. No name tags distributed by a central authority. Just voices in the space.

Stuart Cheshire watched brilliant people struggle with printing, and he thought: this is wrong. Networks should be easier than this. Twenty-five years later, you plug in a printer and it appears on your phone. You bring a laptop to a meeting and it finds the display. Your smart home hums with devices discovering each other in the dark.

That's port 5353. The port that taught devices to say their own names.

Frequently Asked Questions

Was this page helpful?

๐Ÿ˜”
๐Ÿคจ
๐Ÿ˜ƒ
Port 5353: mDNS โ€” The Protocol That Taught Devices to Introduce Themselves โ€ข Connected