Missed notification randomly via FCM to my phone

I am running HA 2026.8.3 on Raspberry Pi 5 using Docker with network_mode : host, my phone is SamsungS25+ running latest HA companion app. My router is Ubiquiti Edgerouter 6p and it has been configured to use Google DNS on router level many years ago. Now, on HA automation, I noticed that the notification was missed randomly when I am not home using 5G/LTE. There was error in the log “Error sending notification to SamsungS25” with no other details. This meant HA wasn’t able to reach my phone yet. So I went deeper and enabled debug mode and found that “aiohttp” lib:

\File "/usr/local/lib/python3.14/site-packages/aiohttp/connector.py", line 1577, in _create_direct_connection
raise ClientConnectorDNSError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host mobile-apps.home-assistant.io:443 ssl:default \[Timeout while contacting DNS servers\]
2026-09-12 13:02:51.473 ERROR (MainThread) \[homeassistant.components.mobile_app.notify] Error sending notification to SamsungS25

This only happens randomly, sometimes notification worked. Then found that this timeout looks like it has something to do with IPV6. My router has never configured to use IPV6 and Raspberry Pi has IPV6 enabled by default. When HA does the DNS lookup to send message via FCM, DNS servers returns both IPV6 and IPV4 and I guess the code uses IPV6 over IPV4 and failed.

It seems like if I disable IPV6 on Pi5 (network adapter level), the problem went away:

sudo nmcli connection modify “Wired connection 1” ipv6.method “disabled”

The other workaround is to use persistent connection on the companion app (using Cloudflare Tunnel with mTLS) so it forces HA to use web socket for notification.

If my theory is correct, why HA not falls back to IPV4 when IPV6 fails and try again? Missed notification is pretty horrible. Anyone experienced the same issue?

I am replying to myself.. that didn’t fix the issue.. the issue came back. Same error, but it doesn’t happen all the time. I also noticed that other DNS timeout errors too:

Logger: custom_components.hacs Source: custom_components/hacs/base.py:848
Integration: HACS (documentation, issues) First occurred: September 15, 2026 at 11:21:58 PM (8 occurrences)
Last logged: 5:21:58 AM
Could not update plugin - Error fetching data from HACS: Cannot connect to host data-v2.hacs.xyz:443 ssl:default [Network unreachable]
Could not update integration - Error fetching data from HACS: Cannot connect to host data-v2.hacs.xyz:443 ssl:default [Timeout while contacting DNS servers]
Could not update theme - Error fetching data from HACS: Cannot connect to host data-v2.hacs.xyz:443 ssl:default [Timeout while contacting DNS servers]
Could not update plugin - Error fetching data from HACS: Cannot connect to host data-v2.hacs.xyz:443 ssl:default [Timeout while contacting DNS servers]
Could not update template - Error fetching data from HACS: Cannot connect to host data-v2.hacs.xyz:443 ssl:default [Timeout while contacting DNS servers]

Manual dns lookup, or even curl worked perfectly. I even tried docker command using python script to use aiohttp.resolver and it is resolving all DNS properly. Help anyone?

I updated to the latest HA 2026.9.2 and was still experiencing the same intermittent notification and DNS timeout issue. I suspect not many people are affected by this since I don’t see anyone reply, I am here to answer myself again. I finally figured out what was happening in my setup. Hope this post can help some of you.

I have been using Google DNS 8.8.8.8 and 8.8.4.4 on my EdgeRouter 6P system level for a decade, meaning any devices on my network (LAN/Wifi) still have to go through the router using dnsmasq for DNS lookup. According to what I read, HA upgraded aiodns, pycares and c-ares libraries since 2025.5 requires stricter handling of EDNS(0) and DNS Cookies. My EdgeRouter 6P has been rock solid but it hasn’t been configured out of the box to support or align with the EDNS cookies spec.

Solution:
If you are using static IP on Docker (network_mode=host, no bridge), just run this command on the host (in my case Raspberry Pi 5):

sudo nmcli connection modify “Wired connection 1” ipv4.dns “8.8.8.8 8.8.4.4”
sudo nmcli connection modify “Wired connection 1” ipv4.ignore-auto-dns yes
sudo nmcli connection down “Wired connection 1” && sudo nmcli connection up “Wired connection 1”

If your HA host uses DHCP, another option is to change the DHCP DNS settings on your router and configure the HA subnet/VLAN to hand out a public DNS server such as Google DNS or Cloudflare DNS.

What this does is make HA bypasses the router on DNS lookup, no more DNS forwarding using dnsmasq. There’s a major difference between setting 8.8.8.8 and 8.8.4.4 at the router level vs the host level. Of course, you can buy a new router that supports EDNS(0) and DNS Cookies.

It is also worth noting that GitHub home-assistant/core issues #161877, #145708, and #178434 appear to be related to this problem, and all three are still open for more than a year. I doubt they will be fixed in Home Assistant, especially if the underlying behavior is considered standards compliance in newer versions of c-ares. In my opinion, I still think there should be a fallback option.

Using public DNS directly from the host works perfectly, no more “Timeout while contacting DNS servers” and all FCM notification to Android works perfectly. Hope this helps.