home-assistant.io
home-assistant.io copied to clipboard
Should we warn about the external DNS use for Sonos speakers?
Feedback
In short, my Sonos speakers have stopped using my local DNS for name resolution and use their own external DNS. Should we warn people in the Network requirements section that their local domain must be externally accessible for local media playback and TTS to work?
URL
https://www.home-assistant.io/integrations/sonos/
Version
2024.2.1
Additional information
I noticed local playback of media and TTS wasn't working with my Sonos speakers (setting options do work however, as well as polling). I noticed that the integration sends the url as follow:
https://my.domain.net/media/local/test.mp3?authSig=[...]
However, I have noticed that my Sonos speaker don't do their name resolution through my own split-horizon DNS (a pihole) but some hardcoded DNS servers outside of my network, which means that my.domain.net is resolved through their DNS servers, not mine. The last DNS queries made by my 3 Sonos speakers were made about a month ago:
Then, in the Sonos app (iOS), I get the following error because my FQDN is only internal (resolved only by my local DNS, not by any external DNS).
If I set a CNAME entry to the external side of my domain for my.domain.net, I can see the Sonos speakers attempting to hit the associated IP instead of hitting my internal IP. Furthermore, if I try to play an externally accessible mp3 file, it works.
Also, the last example for advertise_addr does not work for fixing this particular issue. The Sonos speakers still attempt to use their external DNS servers and connect to that ip, instead of advertise_addr.
# Example configuration.yaml entry modifying the advertised host address
sonos:
media_player:
advertise_addr: 192.0.2.1
The only thing that really worked at the end was exposing my home assistant to the internet (port 443 TCP) and pointing a CNAME record to my public IP, then "magically", media playback and TTS would now work.
Hey there @jjlawren, mind taking a look at this feedback as it has been labeled with an integration (sonos
) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of sonos
can trigger bot actions by commenting:
-
@home-assistant close
Closes the feedback. -
@home-assistant rename Awesome new title
Renames the feedback. -
@home-assistant reopen
Reopen the feedback. -
@home-assistant unassign sonos
Removes the current integration label and assignees on the feedback, add the integration domain after the command. -
@home-assistant add-label needs-more-information
Add a label (needs-more-information) to the feedback. -
@home-assistant remove-label needs-more-information
Remove a label (needs-more-information) on the feedback.
I found another workaround that is easier than just exposing the Home Assistant instance. I was able to set an A entry for the external name servers pointing to the local IP address that the Home Assistant host has. In this way, the Sonos speakers can resolve the right IP even when they don't use my own local DNS for name resolution.
However, the downside of this requires that the external URL must be different from the internal URL, since if you roam outside of your home without a VPN, you hit public DNS and hence resolve the local address instead of the external address of your home network.I think this is only an issue if you expose your Home Assistant instance to the internet.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved. If this issue is still relevant, please let us know by leaving a comment 👍 This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.