home-assistant / iOS

:iphone: Home Assistant for Apple platforms
https://companion.home-assistant.io
Other
1.58k stars 306 forks source link

HA iOS app cannot cope with changing DNS of HA instance #2922

Open Dinth opened 2 months ago

Dinth commented 2 months ago

iOS device model, version and app version Model Name: iphone 12 pro Software Version: 17.6.1 App version: 2024.5

Home Assistant Core Version 2024.8.1

Describe the bug It looks like HA iOS app is struggling to cope with changing DNS record of HA instance. In my setup, the domain points to my external IP on external connection, but on the local network (local DNS server) that record is overridden with IP of the nginx reverse proxy instance. Everything works fine when im on an external network. On the internal network everything works fine in a browser, but the app has issues:

If iOS app cannot cope with changing DNS records of HA instance, then possibly this can also affect ppl behind DynDNS

To Reproduce

  1. Have HA instance behind nginx reverse proxy
  2. Set up DNS override for HA domain to point to the local nginx rev proxy ip on the local DNS server.

Expected behavior The app should be able to cope with the changes of DNS response for HA domain.

bgoncal commented 2 months ago

How did you configure internal and external URL in the app? Can you share screenshots?

Dinth commented 3 weeks ago

Hi. Sorry for the late reply, but i started a new job and all my homelab activities are on hold currently.

I have tried both: to not set internal URL and to put the same domain name both in internal and external fields.

I appreciate that the app has an user-friendly feature of setting up direct, internal IP (for users who dont know how to, or dont want to configure that in their DNS servers), but the problem here seems to be different - that the app doesnt seem to be resolving the domain name in a correct way. That causes problems not only in my particular case (and maybe in my case it could indeed be worked around by setting local IP as internal IP in the app), but this will also likely cause problems in other use cases like VPN, Cloudflare WARP, users with domains with DynDNS, etc, where setting internal IP in the app wont work.

collse commented 2 weeks ago

I have the same issue, changed my dns name and it constantly seems to forget what I’ve setup. Set internal and external address, changed all references in HA still all the time the app starts with need to sign in again and offers the internal ip address information- this is on iOS

I’ve even deleted the app and tried to start from scratch - no dice

Dinth commented 1 week ago

Its even weirder. While im confident that setting my DNS server to respond with the local IP while locally is triggering the issue (for me, for my partner it worked fine), i have now removed the entry on my DNS server so it always responds with the external IP (which is then routed via reverse proxy to the internal IP) and it broke my partners HA app while on wifi, while my still doesnt work.