What's new

mDNs / Bonjour / Multicast

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Donga120

Regular Contributor
Hi everyone,

I am having issues with 3 HomePods in my home. I have 2 AirPlay receivers which work flawlessly, however my HomePods are very hit and miss to work, I took one on holiday and noticed it was much better than at home.

Are there any settings or things to enable/check to ensure mDNs / Bonjour / Multicast is working correctly. I have used the discovery app on my Mac and I can see the HomePods showing.

I had them on 5GHz, now switched to 2.4 to see if it makes a difference, I have dedicated channels for the 2.4ghz and 5ghz SSID's and these are my Wi-Fi settings below (I have just enabled IGMP to see if it helps). I have kept my devices/HomePods on the same SSID (they are separated between 2.4 and 5 with different SSID's)

2.4GHz

Screenshot 2023-08-15 at 18.40.29.png


5GHz

Screenshot 2023-08-15 at 18.40.14.png


Anything I can run via ssh to ensure the services are running properly?
 
Hi everyone,

I am having issues with 3 HomePods in my home. I have 2 AirPlay receivers which work flawlessly, however my HomePods are very hit and miss to work, I took one on holiday and noticed it was much better than at home.

Are there any settings or things to enable/check to ensure mDNs / Bonjour / Multicast is working correctly. I have used the discovery app on my Mac and I can see the HomePods showing.

I had them on 5GHz, now switched to 2.4 to see if it makes a difference, I have dedicated channels for the 2.4ghz and 5ghz SSID's and these are my Wi-Fi settings below (I have just enabled IGMP to see if it helps). I have kept my devices/HomePods on the same SSID (they are separated between 2.4 and 5 with different SSID's)

2.4GHz

View attachment 52379


5GHz

View attachment 52380


Anything I can run via ssh to ensure the services are running properly?

Do you have them on a guest network or on the main wireless? It will not work on a guest network if you have "access intranet" disabled.

Generally it should work fine without messing with any multicast settings (either under wireless or under WAN).
 
Do you have them on a guest network or on the main wireless? It will not work on a guest network if you have "access intranet" disabled.

Generally it should work fine without messing with any multicast settings (either under wireless or under WAN).

They are on the main network. One thing I would say is my Router goes through AGH which is on my Synology, so not sure if this could possibly affect it, although the HomePods have static IP's and are excluded from any AGH filtering, however wether this would cause discovery issues I don't know.
 
Last edited:
They are on the main network.

IGMP snooping can actually interfere so I'd leave that off.

How is the signal strength on the devices - you have roaming assistant enabled, maybe it is kicking them off?

Is multicast completely disabled on your LAN/IPTV tab? Unless your ISP requires it all that should be disabled.

May need to start digging in the logs to see what is going on. MDNS is really only used for discovery, if the devices are discovered ok but functionality is problematic it probably isn't MDNS.
 
IGMP snooping can actually interfere so I'd leave that off.

How is the signal strength on the devices - you have roaming assistant enabled, maybe it is kicking them off?

Is multicast completely disabled on your LAN/IPTV tab? Unless your ISP requires it all that should be disabled.

May need to start digging in the logs to see what is going on. MDNS is really only used for discovery, if the devices are discovered ok but functionality is problematic it probably isn't MDNS.

See my edit in the post above re AGH/Synology.

I have turned IGMP off.

Signal strength is not too bad, they hover between -52 and -59 however the one in the kitchen is right next to the router so doubt it would be signal strength in this case.

Multicast is off under LAN > IPTV


EDIT: Should my router be .lan and not .local? I did change the domain name to lan in the LAN tab.

Code:
user@GT-AX6000-FAB8:/tmp/home/root# ps w | grep avahi-daemon
12746 user      5984 S    grep avahi-daemon
31367 nobody    3260 S    avahi-daemon: running [GT-AX6000-FAB8.local]
user@GT-AX6000-FAB8:/tmp/home/root#


Is there anyway to see what services are running?
 
Last edited:
AsusWRT is missing libnss-mdns (part of avahi) - that missing component can contribute towards issues with Bonjour lookups...

avahi-daemon is only part of the solution - it cannot do the lookups without the libnss-mdns
 
AsusWRT is missing libnss-mdns (part of avahi) - that missing component can contribute towards issues with Bonjour lookups...

avahi-daemon is only part of the solution - it cannot do the lookups without the libnss-mdns
Would libnss be relevant from a router's point of view, or only from a client's point of view?
 
See my edit in the post above re AGH/Synology.

I have turned IGMP off.

Signal strength is not too bad, they hover between -52 and -59 however the one in the kitchen is right next to the router so doubt it would be signal strength in this case.

Multicast is off under LAN > IPTV


EDIT: Should my router be .lan and not .local? I did change the domain name to lan in the LAN tab.

Code:
user@GT-AX6000-FAB8:/tmp/home/root# ps w | grep avahi-daemon
12746 user      5984 S    grep avahi-daemon
31367 nobody    3260 S    avahi-daemon: running [GT-AX6000-FAB8.local]
user@GT-AX6000-FAB8:/tmp/home/root#


Is there anyway to see what services are running?

Do not use .local on the router! Will definitely cause MDNS problems.
 
Do not use .local on the router! Will definitely cause MDNS problems.
I have changed it to lan, but it still showing as .local. I have clicked applied, and rebooted the router.... host file is below, is this actually correct?

Screenshot 2023-08-15 at 20.56.07.pngScreenshot 2023-08-15 at 21.11.48.png
 
Last edited:
.local is automatically assigned by mDNS, and will be separate from the DNS FQDN that you defined as AX6000.lan.
 
@Donga120 - sorry to hear that you are having these issues. I have been struggling with this issue for 2 years (on and off) and have never really found the underlying issue or a 100% solution.

See thread below for some more info that may help somewhat. In my many tests and struggles here is what I have found...


1. issue started from 386 code base but I think got worse at the start of 388 (but is a little better now)
2. changing settings in asus router has no impact - maybe some placebo
3. impacts both stock and merlin but some releases are better than others - so i think it might be wifi driver/code that is the root cause
4. mainly impacts homepods when connected to a aimesh node - but not always - but I think it is might be related to how/what is configured in the firmware to support aimesh networks
5. generally I think it happens less if the nodes are on stock rather than merlin. Although I have merlin 388.4b2 on router and nodes at the moment and all has been good. I tried this as asus has done a bit of work on aimesh and I wanted to use same GPL code on all routers/nodes
6. when the issue occurs, I can scan my network and see that all of my homepods are correctly advertising the hap protocol
7. nothing to do with 2.4 v 5g network - have tried both

solutions - ymmv...
1. when it occurs, try binding the affected homepod to another node without doing anything else. I find this 'clears' the issue. then just unbind and let the homepod roam back when it is ready - not really a solution but quite an easy way to get it back online
2. I am not sure about this but if you have a appletv on your network and it acting as the 'primary hub - as in it is connected and homepods are in standby then the issue seems to happen more often.
3. You can't set a default or set a homepod to be the hub so it is worth trying to remove the appletv from homekit. It will no longer be a hub but still works fine. When you do this only your homepods can act as the hub

Sorry I can't be more help and this is a very annoying issue that seems to be unsolvable (for me anyway). Happy to help test different scenarios with you and hopefully we can find a solution together!

To finish on a positive, the latest 388.4 code seems to be quite a good one in my environment!
 
Would libnss be relevant from a router's point of view, or only from a client's point of view?

there is no client/server with mDNS (recall bonjour is peer to peer) - so the first one to respond to the query... if the avahi-daemon on the router responds first, the lookup will fail...
 
there is no client/server with mDNS (recall bonjour is peer to peer) - so the first one to respond to the query... if the avahi-daemon on the router responds first, the lookup will fail...
My question was more about whether that library is only needed when a client does a query, or when a server (in this case, the router) answers queries.

I'll see if it's doable to add it, or if the kernel/libc version might be an issue.
 
My question was more about whether that library is only needed when a client does a query, or when a server (in this case, the router) answers queries.

I'll see if it's doable to add it, or if the kernel/libc version might be an issue.

Everyone is both a querier and responder, one would assume whatever is required for one is required for the other. I guess if you don't care if the router maintains a list of MDNS peers and only replies to queries, maybe less is needed. Not entirely sure what benefit there is to having the router even respond. I'm not familiar enough to know if there is a query for router or gateway but not sure why there would need to be.

I guess there must be some reason they have support in it, do asus routers claim to be "alexa compatible" or something? Maybe it is related to the Asus app.
 
My tests are by no means exhaustive, but ping device.local from a Mac or a Debian box (systemd) shows (via Wireshark) an mDNS query directly to 224.0.0.251 (a broadcast address) and a mDNS response to 224.0.0.251 directly from the device being pinged. I assume both the Mac and the Debian box are Bonjour/mDNS aware as would be a HomePod. Mac also generates a mDNS query to the IPv6 IP. As I understand mDNS, this is how it should work - routers are optional! Clients look for services - devices/servers respond with the services they have.

Note that a ping device.lan or ping device are DNS queries directed to the Asus router and the responses are unicast from the router to the source device.

I was curious why /etc/nsswitch.conf on the router reads:

hosts: files mdns4_minimal [NOTFOUND=return] dns

There are /lib/libnss_files.so.2 and /lib/libnss_dns.so.2 files, so why the mdns4_minimal?
 
Bonjour is probably better described as one to many in both directions at the data link layer (L2), so for the HomePod issue you may have to add this to a /jffs/scripts/avahi-daemon.conf:

[reflector]
enable-reflector=yes
 
Bonjour is probably better described as one to many in both directions at the data link layer (L2), so for the HomePod issue you may have to add this to a /jffs/scripts/avahi-daemon.conf:

[reflector]
enable-reflector=yes

It starts out as one to many, then becomes many to many, then starts overloading crap (when devices aren't properly designed anyway). Basically every message is a broadcast to the same address and every other device thinks it has to respond to every response. Ick.
 
I guess there must be some reason they have support in it, do asus routers claim to be "alexa compatible" or something?
It was probably mostly for Timemachine support.
 
It was probably mostly for Timemachine support.

Oh yeah, forgot about that (not an Apple user). Wonder how well it actually works.

Personally, no interest in having my files on an internet facing device.
 
It was probably mostly for Timemachine support.

Mostly, but Apple devices default to that for other services as well (airplay, airprint are a couple of examples).

Also recall also that Win10 uses mDNS for resource discovery as well (along with all the other methods)... Also Linux makes significant use of avahi services, at least with Ubuntu and clones (and it's in every major repo/distro).

Anyways - libnss is already in AsusWRT, it's just missing the libnss-mdns library... in my private exploration of the WiFi bug I mentioned some time back, I dropped libnss-mdns into my private builds, as it made testing much easier...

IIRC - the library might be in Entware if memory serves me right...
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top