On a Mac, run `dns-sd -B _ssh._tcp` to find all machines advertising SSH on your local network. From there, you can either use the advertised `.local` hostname directly, or you can pass the advertised friendly name to `dns-sd -G v4` to resolve it to an IPv4 address.
AFAIK you must always specify a service like `_ssh._tcp` or `_http._tcp`; you can’t ask dns-sd to just dump all the advertised mDNS services on your network. That might be possible with the underlying `nw_browser_t` APIs, though.
This is to discover services, which you really shouldn't need to do by hand outside of troubleshooting, your apps should be doing it themselves.
For address discovery which is what we're really talking about here it's just "<hostname>.local"
Thanks, so this one works for my Mac (.50) in particular but not my RPi on the same network with an SSH server, because turns out it doesn't advertise that by default.
"you can’t ask dns-sd to just dump all the advertised mDNS services on your network": I ran into this too. So besides the defaults and maybe network itself standing in the way, the tooling around mDNS is user-unfriendly.