Remix.run Logo
▲ mahboi 3 days ago

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.

▲justsomehnguy 2 days ago | parent [-]

Yes, thanks, I do not want even any SSH server to be advertised on mDNS.

▲mahboi 2 days ago | parent [-]

Me neither really, I just want to reliably know the hostname<->ipaddr mapping on a network.

▲justsomehnguy 2 days ago | parent [-]

Run a classic DNS then.

Or hosts.

You are arguing what mDNS doesn't work the exact way you want therefore mDNS is not working for everyone else.

▲mahboi 2 days ago | parent [-]

mDNS doesn't work for the average user. They're also not going to set up regular DNS unless they're trying to cope with IPv6. They memorize IP addresses as needed. It's not just me.

There must be like 3 end users who actually use mDNS knowingly, which is why the tooling feels like an unhappy path. Like there's no way to list all hosts, even though the OS presumably knows that somewhere. Supposedly this is in the spec. The best you can do is list hosts that advertise services.

▲wolrah 2 days ago | parent [-]

> mDNS doesn't work for the average user.

What did mDNS do to hurt you? You are spouting blatant wrongness in this thread.

mDNS is mostly FOR the average user, and it works great for them. AirPlay, Google Cast, Miracast, all mDNS. Google Home, Apple HomeKit, Matter, all mDNS. AirPrint/IPP/Mopria printers, all mDNS. Windows still uses a lot of its own proprietary autodiscovery but even there Microsoft has prioritized mDNS over the old NBT stuff.

> They memorize IP addresses as needed.

No, normal people use names, mostly delivered these days over mDNS. There are millions of consumer-targeted appliances and entry-level DIY projects intended for people who need a picture to not put the SD card in the Raspberry Pi where the instructions, after powering it up, say to open up a browser and navigate to <appliancename>.local (or more often with commercial devices, open the app which will be listening for that specific appliance's service advertisement.

> There must be like 3 end users who actually use mDNS knowingly, which is why the tooling feels like an unhappy path.

You are right on this, most users don't use it knowingly, because it just works and they don't have to know anything about what's been built on top of it.

> Like there's no way to list all hosts, even though the OS presumably knows that somewhere.

No, the OS does not know all hosts, it only knows the hosts that have advertised or probed for conflicting names while it's been attached to the network. If you connect your device to the network after I've connected mine, as long as there's not a name conflict your device has no idea mine exists unless it's advertising services. Service advertisements are cached, but hostnames are not because for obvious reasons you generally aren't going to be accessing most of the hosts on a given network ever. When you need to access whatever.local your device emits a mDNS query looking for A or AAAA records the same as it would for normal DNS, and caches the result based on TTL the same way as it would for a normal DNS record.

> The best you can do is list hosts that advertise services.

You're saying this like there's some other solution which lets you list every host in the network even if it's not advertising services, which...there isn't.

▲mahboi 10 hours ago | parent | next [-]

The question was if someone wants to connect to a device manually, do they use mDNS or IP. But anyway, you gave a list of some of the flakiest services. I've used Macs since the early 2000s, there's no bonjour without some pain. Just had a meeting today where they wanted to AirPlay to the conference room TV and gave up. It's a FAQ how to forcibly AirPlay to a given ip instead of relying on discovery. Many other commercial IoT devices use ad hoc wifi networks, BT, etc for initial setup.

You mentioned newbs using RPis. https://www.raspberrypi.com/documentation/computers/remote-a... "Most methods of connecting to your Raspberry Pi from another machine require you to know the local IP address of your Raspberry Pi" and then, as the main suggested approach, it has you write down the IP displayed onscreen. OctoPrint does suggest mDNS, but with the caveat "if your computer supports bonjour," otherwise says to use the IP.

> You're saying this like there's some other solution which lets you list every host in the network even if it's not advertising services, which...there isn't.

I mean yeah, that's part of the problem. You can blame the devices for having bad defaults, but all of them use ipv4 properly. mDNS is more moving parts.

▲ 2 days ago | parent | prev | next [-]
[deleted]
▲justsomehnguy a day ago | parent | prev [-]

> No, normal people use names, mostly delivered these days over mDNS

You said what I would had said if I had the patience to do so, with only one caveat: most people don't even use the names because most of the time they do the thing, it runs the discovery and show up the devices which did respond.

Sure, there are some people who use mDNS names to SSH to the some machine. Like a dozen on the whole planet.