Best mDNS package for OpenWrt?

I want to use mDNS / ZeroConf to connect to devices on the LAN using names, not addresses. I have read the ZeroConf page on the wiki that presents several alternatives without any recommendation or comparison of benefits.

Can someone give a summary of which of those packages is good/reliable/best for use in 2024/modern OpenWrt? Thanks.

You can connect using names without mDNS (if that's the only thing you need). Check table named 'Active DHCP Leases' on OpenWrt's status page. First column contains hostnames. You can ping, ssh them, - whatever pleases your heart.

I don't know if "that's all I need..." Let me write a more focused set of questions:

  • In 23.05.x, does the OpenWrt router advertise its own name with mDNS? (It would be fun to use "ssh root@my-router.local" instead of typing the IP address...)
  • Same question, but can I browse to the LuCI web interface at "my-router.local"?
  • If so, how does OpenWrt derive the host name ("my-router") in that mDNS name?
  • I have a Mac mini that currently seems to advertise itself as "Mac-mini2.local". Is that device doing it on its own, or does it need assistance from software on my router?
  • I have a Raspberry Pi running Ubuntu 22.04. It currently seems to advertise itself as "RPi4.local". Is that device doing it on its own, or does it need assistance from software on my router?

If the built-in mDNS capabilities do all the above, I'll modify that ZeroConf page to highlight those capabilities.

If not, what package would be recommended? Thanks again

Change .local to .lan and you're essentially describing the way it works out of the box. How it works? Dnsmasq does it. Yes, you can connect to your router by ssh root@openwrt just after booting your fresh OpenWrt installation.

On the page you linked to, the second bulleted list contains this line: " * umdns - OpenWrt own package. Recommended."

So it says "recommended" for that one, but doesn't say that for any of the other ones. It's probably designed to have a small file size, for routers with limited storage.

Not by default. If you want this, install umdns which sets up a mDNS responder on OpenWrt without any further configuration.

In Linux (which OpenWrt is based on), the host name is usually set in /etc/hostname. This can be changed in LuCI → System → System.

The whole point of mDNS is that it doesn't require running a DNS server on the local network to serve local names. No assistance from the router is required. Both the resolver and the responder side needs to understand mDNS, of course. It works using the multicast addresses 224.0.0.251 or ff02::fb, which all mDNS responders (including your Mac mini and your Raspberry Pi) listen on.

That being said, OpenWrt already runs a local DNS server, as @timur.davletshin already explained. So you can also access your devices using the lan domain instead of local. This works on OpenWrt because:

  • It advertises itself as the DNS server on the local network using DHCP or RA messages. It also advertises the domain used by the network, which is lan by default (but this can be changed).
  • It adds the appropriate A and AAAA records to its DNS server via information given to its DHCP server by the hosts. So Mac-mini2.lan and RPI4.lan should work on your network thanks to OpenWrt.
  • It also adds the appropriate A and AAAA records for its own host name. Since OpenWrt is the default host name, OpenWrt.lan works.

The default daemons odhcpd and dnsmasq work together to provide the above functions. So if all you want is name resolution, OpenWrt does it for you out of the box.

None of this interferes with mDNS, so you can still use RPI4.local, etc. You install umdns if you want OpenWrt to join the mDNS party, but OpenWrt will still host the local DNS party on your behalf.

By default, OpenWrt doesn't ship with an mDNS implementation, installing it however is as simple as installing the umdns package. For mDNS/ zeroconf, the *.local zone is reserved, services can register their presence (e.g. OpenWrt registers the presence of its sshd for IPv4 and IPv6) via zeroconf, avahi, etc.

However, DNS resolution for dynamic DHCP leases and the router's own hostname (e.g. openwrt.lan) is enabled by default, for static DHCP leases there is option dns '1' providing the same. For DNS, OpenWrt uses *.lan by default, but you can use global (real) domains as well (e.g. *.home.example.com).