logoalt Hacker News

mahboi • today at 7:04 PM • 2 replies • view on HN

I have a completely default single router setup at home. I know .50 is my desktop and .1 is my router. How do I reach that via mDNS instead? Pretty sure this is broken.

  ~ $ arp -a
  ? (192.168.50.1) at e8:9c:25:52:83:10 on en0 ifscope [ethernet]
  ? (192.168.50.9) at 64:9a:63:eb:ed:f1 on en0 ifscope [ethernet]
  ? (192.168.50.50) at 14:98:77:70:17:a7 on en0 ifscope [ethernet]

Replies

dcrazy • today at 7:18 PM

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.

➕ show 2 replies
wolrah • today at 7:24 PM

<hostname>.local

Here's me pinging my laptop (macOS 27) from my file server (Ubuntu 24.04)

  ~ ping persephone.local
 PING persephone.local (fd82:74ca:1cef:385a:1897:2e4b:a726:18b6%3) 56 data bytes
 64 bytes from fd82:74ca:1cef:385a:1897:2e4b:a726:18b6: icmp_seq=1 ttl=64 time=0.496 ms
 64 bytes from fd82:74ca:1cef:385a:1897:2e4b:a726:18b6: icmp_seq=2 ttl=64 time=0.515 ms
 ^C
 --- persephone.local ping statistics ---
 2 packets transmitted, 2 received, 0% packet loss, time 1001ms
 rtt min/avg/max/mdev = 0.496/0.505/0.515/0.009 ms
➕ show 1 reply