3 Integrations all went offline together - either DNS or HACS issue? (maybe python error?)

Hi All;

I have been away for the weekend and come home to three integrations all offline;

All of the above have worked fine for years for me, no changes to HA or my host system that I can tell, yet they throw a mixture of similar errors;

  • Failed setup, will retry: Cannot connect to host api.weather.bom.gov.au:443 ssl:default [Could not contact DNS servers]
  • Setup failed for custom integration 'automate': Requirements for automate not found: ['aiopulse2==0.10.0'].
  • Setup failed for custom integration 'opensprinkler': Requirements for opensprinkler not found: ['pyopensprinkler==0.7.14'].
  • <Integration vinteo/hass-opensprinkler> Cannot connect to host api.github.com:443 ssl:default [Could not contact DNS servers]
  • <Integration sillyfrog/Automate-Pulse-v2> Cannot connect to host api.github.com:443 ssl:default [Could not contact DNS servers]
  • <Integration vinteo/hass-opensprinkler> No manifest.json file found 'custom_components/None/manifest.json'
  • <Integration sillyfrog/Automate-Pulse-v2> No manifest.json file found 'custom_components/None/manifest.json'

At first I looked into my 2 PiHoles (seperate host network IP’s), both are running, and both I can not see any DNS lookups for the BOM.gov.au website. Then I tried reloading these integrations in HACS, and i’m not sure that’s even done anything, each time I click re-download, nothing actually happens.

Is anyone able to steer me where to start troubleshooting? The weather one has broken many automations relating to the house heating and in my kids room’s (sensor unavailable), and the blinds one was super handy in the morning and evening.

I don’t know how else to diagnose this.

Any comments or help would be greatly appreciated.

Did you try to restart HA ?

And also restart your router.
It is not unheard of for routers to get into a mode where DNS to certain sites suddenly is not possible, yet others work.

HA, the host system and router have all been restarted many times trying to figure this out.

Can anyone with these integrations chime in that might have them still working?

How else can I manually verify the DNS is working?

So I found the BOM Integration debug option, and found this;

This error originated from a custom integration.

Logger: custom_components.bureau_of_meteorology.config_flow
Source: custom_components/bureau_of_meteorology/config_flow.py:66
integration: Bureau of Meteorology (documentation, issues)
First occurred: March 17, 2025 at 19:40:58 (1 occurrences)
Last logged: March 17, 2025 at 19:40:58

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/resolver.py", line 103, in resolve
    resp = await self._resolver.getaddrinfo(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
    )
    ^
aiodns.error.DNSError: (11, 'Could not contact DNS servers')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1362, in _create_direct_connection
    hosts = await self._resolve_host(host, port, traces=traces)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 995, in _resolve_host
    return await asyncio.shield(resolved_host_task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1026, in _resolve_host_with_throttle
    addrs = await self._resolver.resolve(host, port, family=self._family)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/resolver.py", line 112, in resolve
    raise OSError(None, msg) from exc
OSError: [Errno None] Could not contact DNS servers

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/bureau_of_meteorology/config_flow.py", line 66, in async_step_user
    await self.collector.get_locations_data()
  File "/config/custom_components/bureau_of_meteorology/PyBoM/collector.py", line 36, in get_locations_data
    response = await session.get(URL_BASE + self.geohash7)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 703, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        req, traces=traces, timeout=real_timeout
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 548, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1056, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1368, in _create_direct_connection
    raise ClientConnectorDNSError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host api.weather.bom.gov.au:443 ssl:default [Could not contact DNS servers]

Using the PiHole tail log feature; tail -F /var/log/pihole/pihole.log I can see zero calls to the URL it lists as an error.

Does anyone know anything about these python errors?

ta

If HA detect issues with the DNS server, then it will switch to Cloudflares DNS server as a failback.
If you run pihole on the HA server, then pihole might not be online when HA is up after a restart of the system and therefore it fails and drops to the failback server.

Thanks Wally,

If it switches to cloudflares, then it should be operational. Why do I get DNS errors then?

I do not know you set up, but maybe DNS requests have been blocked for some hosts in your firewall.
It is a common step for many pihole users.

HA in Docker, PiHole in the same Docker. Both can talk, I’ve checked. I’ve even eliminated PiHole, and gone straight to 1.1.1.1, and still no luck.

I’m wondering if it’s some python issue?

It appears I can’t view, upgrade, or re-download anything from HACS.

I have no idea whats happening here, it’s like internet access isn’t working - but some integrations that require it are (windy.com).

Can anyone help please?

Solution Found;

Unknown why; but since upgrading to PiHole-6 (apparently triggered while I was away), my previous HA docker install used network_mode: bridge - which has worked fine forever.

Now, it doesn’t work.

I have changed the docker container / stack to be network_mode: host.

Everything resumed normal operation; OpenSprinkler, BOM weather, Roleease Automate blinds, Android phone notifications, and a few other things I hadn’t picked up on.

The only change I can see is I was previously on 2025.1.2, and jumped to 2025.3.1, and can see #137492 has done something with DNS? @bdraco ?

That change is for mDNS and the .local domain reserved for that service.

So my external url that also works internally by PiHole that captures the DNS request and bounces it back to the HA IP address?

No, the .local domain is a serverless name system and only works on one subnet unless you set up special mDNS reflectors.
It does not work for external urls.

How does it get the domain in the first place?

My PiHoles capture my urlname.com and translate it into an internal IP of 192.168.1.100, so my urlname.com works both internally and externally.

.local is a special domain reserved for mDNS hosts.
A host will announce itself on the local network and the other devices on the network that are also running mDNS will see this announcement and add it to their list of hosts.

This is how Home Assistant can be reached by http://homeassistant.local:8123

1 Like

Thanks for the explantion. There must be something up with my Host system (ubuntu 24.04) or Docker, as it was happy with all containers in Bridge mode since forever until recently.

I have no idea what’s changed internally for that to happen - I’m assuming an automatic ubuntu update while I was away on the weekend when it all changed.