Ios14 connection issue on local network

Tags: #<Tag:0x00007fc40b8a62c8>

I just upgraded my phone towards ios14 and the iOS companion app can no longer connect to my homeassistant server on my local network. External works fine.
I did allow the home assistant access to the local network.
If I look at a generic network ping app from my phone I am able to resolve and ping the HA host before opening the homeassistant app. As soon as I open the app it does not connect and indicates “a server with the specified hostname does not exist”
I then switch back to the ping app and all of a sudden this app is not able to resolve the host and indicates the error: kCFErrorDomainCFNetwork error 2
Tried different settings with external and internal url, no difference. Before the upgrade I only used the external url since my internal dns resolves the request to the internal host.
It seems to be a dns issue caused by the app.
Anyone a similar experience or ideas how to resolve this?

after further digging the issue seems to be DNS related. IOS14 seems to have some trouble switching between external and internal url’s with the same name but different adresses. In my case the external name is a cname, internal a direct A record. Perhaps the dns caching on IOS14 requires some more work. IOS14 has the new “Local Network” privilige build in, perhaps this has something to do with the issue as well.
Problem occurs especially when you do a refresh in the IOS app by swiping down This is where the error “Unable to connect” comes up.

Finally found someone with exactly the same issue.
Problem is related to dns caching when using cname records and switching between internal and external dns servers.

https://www.binwang.me/2020-11-08-DNS-Resolving-Bug-in-iOS-14.html

Hi leon1, I’m experiencing the same problem: it is almost one month I’m messing around with routers, dns, port forwarding but no way to have the app working when connected on my local network. If you found any solution please let me know

Hi NuccioT, the solution was to add the dyndns host directly in my local dns and point it to the internal host. In my case I was using multiple cnames that should point to different hosts on the inside. I ended up creating additional dyndns hosts using duckdns and creating a corresponding host in my internal dns server pointing my phone to the correct host.
I was hoping Apple would fix this bug in the DNS client but there have been several updates and no change. Hope this helps.

Thank you very much. I gave up for the moment the idea of using local network to access HA. It’s quite curious that if there is such a bug there are so little post about the subject. Much of the stenght of HA is, in my case, the possibility to do things while at home: when outside I have automations and scripts running tasks.
Thank you again for your support and help.