What Is mDNS / Bonjour? .local Hostnames Explained

Published · 8 min read

You open the Files app and your NAS appears in the sidebar. You hit AirPlay and your living room TV is already in the list. You print from your iPhone and the printer just works. You did not configure any of this. You did not type any IP addresses. You did not set up DNS records.

The magic responsible is mDNS — usually packaged as Bonjour on Apple devices — and it has been quietly making your network feel friendly for over twenty years. This guide explains what it is, how it works, why .local hostnames exist, and how to see what is actually being advertised on your network.

The Problem mDNS Solves

Regular DNS (Domain Name System) translates names like pingkit.app into IP addresses by asking a hierarchy of servers on the public internet. This works great for public websites. It does not work for the printer in your spare room. There is no DNS server that knows about your printer. You do not run one. Your ISP does not run one.

You could configure your printer with a static IP, set up a local DNS server, and add a record. People used to do this. It was tedious and broke whenever anything moved. mDNS exists so you do not have to.

How mDNS Actually Works

mDNS uses the same DNS message format as regular DNS — same query types, same record types, same response structure — but sends queries to a multicast address (224.0.0.251 for IPv4, ff02::fb for IPv6) on UDP port 5353. Every device on the network listens on that address. When a query for printer.local arrives, the printer recognises its own name and replies directly to the asking device.

There is no server. There is no central registry. Every device announces itself when it joins the network and answers queries about its own name. This is what makes it "zero-configuration networking" — nothing needs to be set up centrally because every device participates in name resolution for itself.

The .local TLD

The .local top-level domain is reserved by RFC 6762 for use with mDNS. When any application tries to resolve something.local, the operating system sends an mDNS query on the local network instead of querying public DNS. This is why printer.local, livingroom-appletv.local, and nas.local work — the OS knows to route those names to mDNS.

Don't use .local for real DNS records. Some companies historically used .local as an internal Active Directory domain. This conflicts with mDNS and causes weird intermittent issues on Apple devices. Modern guidance is to use .internal or a subdomain of a domain you control.

DNS-SD: Finding Services, Not Just Names

mDNS by itself only resolves names to addresses. To know what services a device offers (AirPlay, printing, file sharing), you need DNS Service Discovery, or DNS-SD. DNS-SD layers on top of mDNS and uses standard DNS record types (PTR, SRV, TXT) to advertise:

Together, mDNS + DNS-SD is what Apple calls Bonjour. The Linux equivalent is Avahi. Windows has its own implementation, and the protocol is open enough that almost every modern OS speaks it.

Common Bonjour Service Types

Service types are written as _servicename._protocol.local. A few you will see often:

Why This Matters for Security

Every Bonjour-enabled device tells the entire local network what it is, what services it offers, and how to connect to it. This is mostly fine and is the whole point. It does mean that anyone on your WiFi can see a list of every smart device you own.

For a home network, this is generally not a problem — you trust the people on your WiFi, or you should not be giving them WiFi. For a guest network, this is exactly why guest networks are isolated by default: you do not want a guest's laptop seeing your HomeKit hubs or printer. Most modern routers handle this automatically.

For shared offices or coworking spaces, be aware that your laptop is broadcasting its hostname and any services it advertises (file sharing, screen sharing, etc.) to everyone on the same WiFi. Disable services you do not need.

Browsing Bonjour Services on iPhone

Apple does not expose a built-in service browser on iPhone, but PingKit's Bonjour Browser tool fills the gap:

  1. Open PingKit and tap Bonjour Browser under the Tools tab.
  2. The app discovers all advertised service types on the network.
  3. Tap any service type to see the devices offering it.
  4. Tap a device to see its hostname, IP address, port, and TXT record key/value pairs.

This is useful when:

When mDNS Stops Working

The most common reasons mDNS does not work on a network:

Conclusion

mDNS / Bonjour is the protocol responsible for almost every "it just works" moment on an Apple device, and increasingly on every other platform too. It uses ordinary DNS message formats sent to a multicast address so that devices can answer questions about themselves without a central server. The .local TLD is reserved for it, DNS-SD layers service discovery on top, and PingKit's Bonjour Browser lets you see exactly what is being advertised on your network.

Related Articles

Browse Every Bonjour Service on Your Network

PingKit's Bonjour Browser shows every advertised service, the devices offering it, and the metadata each device publishes.

Download Free on the App Store