Amakuru.net

NearbyDevices: a menu-bar map of everything on your network

A small macOS menu bar app that discovers every host advertising mDNS/Bonjour or SSDP/UPnP services. Live updates, clickable service pills, smart hostname resolution, and host deduplication.

There’s a moment, on any home or office network, where you ask “what is that?” Some device is advertising itself, mDNS is shouting its name, and you’d like to know whether it’s the printer, the smart TV, or something you should be more concerned about. macOS has the underlying APIs — NWBrowser, DNSServiceResolve, getnameinfo — but no built-in UI for poking at them. NearbyDevices is the small menu-bar app that fills the gap.

NearbyDevices menu bar dropdown listing every host on the LAN, each with colour-coded service pills.

Two protocols, two strategies

Bonjour and SSDP advertise differently, and the app handles them accordingly. mDNS browsers stay alive for the entire session and fire events in real time as devices appear or disappear. SSDP is multicast-poll-based, so the app re-scans every 60 seconds.

Hosts get a 30-second grace period before disappearing, which prevents flicker from brief mDNS advertisement gaps; a periodic sweep removes anything not seen in 3 minutes. The protocols are noisy enough that without these timings the UI churns every time a device misses an advertisement.

Service pills, clickable

Each host shows pills for the services it advertises, colour-coded by category. Click them: SSH opens Terminal, HTTP opens a browser, SMB opens Finder, VNC opens Screen Sharing, IPP opens the printer’s web UI.

This is what makes the app worth keeping in the menu bar instead of running dns-sd from a terminal — discovery on its own is a printout, while discovery plus a one-click open path is something you reach for.

A hostname resolution chain

mDNS gives you one name. Reverse DNS often gives a more useful one (DHCP-assigned, or from /etc/hosts). TXT records sometimes carry friendly names (fn=, location_name=, md=). Some devices report UUID-shaped names that nobody wants to read. The app walks all of those and picks whichever is most useful.

A single source gets the easy cases right and the interesting ones wrong; the fallback chain gets most cases right, which is what makes the list scannable in practice.

Was it worth it?

The trickier parts of the implementation are the merge logic (a device advertising ten services should show as one row, not ten) and the lifecycle around mDNS advertisements (which don’t always fire a “removed” event). The TECHNICAL.md in the repo has the longer write-up. The app is small and stays out of the way until I need it.

dmorel69/nearby-devices — Swift, mDNS/Bonjour, SSDP/UPnP, MIT