DNS Error: Unable to Resolve Host

I solved this issue by: Deleting HASSIO, installing Raspbian, installing Docker, and installing Home Assistant.

I did not need to make any changes to the network or the router. Something is broken inside HASSIO.

Iā€™m suddenly having the issue issue, even when using a static IP address with explicity defined local DNS. I can resolve from any other device on my network, but hassio canā€™t resolve anything. Hassio can ping via IP however.

dig ESP_03530F.lan
;; communications error to 172.30.32.3:53: timed out

This is the error I get when attempting to dig. To me it seems something related to the docker container hosting the resolution service.

1 Like

updated home assistant from 2022 to 2023 and DNS stopped working
disabled IPv6 on home assistant (not on router) and DNS started working again

I have these issues too.

I use static IP, set the DNS in Configure network interfaces, enabled only IPv4 on Ethernet and disabled Ethernet IPv6 and all WiFi.

Tried to set the DNS via ha dns update

In terminal, the statically set DNS IP doesnā€™t show up in /etc/resolv.conf. pinging github.com is unsuccessful, pinging 8.8.8.8 is successful.

After adding my DNS to /etc/resolv.conf, pinging github.com was successful, but trying to update my nibegw via ESPHome still results in DNS errors:

INFO ESPHome 2023.10.6
INFO Reading configuration /config/esphome/nibegw.yaml...
INFO Cloning https://github.com/elupus/esphome-nibe.git@None
Failed config

external_components: [source /config/esphome/nibegw.yaml:41]
  - 
    unable to access 'https://github.com/elupus/esphome-nibe.git/': Could not resolve host: github.com.
    source: github://elupus/esphome-nibe

ha dns info:

fallback: true
host: 172.30.32.3
llmnr: true
locals:
- dns://10.42.1.1
mdns: true
servers:
- dns://10.42.1.1
update_available: false
version: 2023.06.2
version_latest: 2023.06.2

You need to restart the entire host to make sure that any DNS cache gets flushed.

Even after rebooting the host, ESPHome Update/Install is still throwing the same error (Could not resolve host: github.com)ā€¦

Is 10.42.1.1 a recursive resolver?
And is any up-chain resolvers also recursive resolvers?

10.42.1.1 is my router, which itself is configured to use my providerā€™s DNS as upstream.

Iā€™m not sure what recursive resolver means.

Recursive mea s that it will keep resolving till it hits an IP, so maps.google.com to will first ask the . nameserver for com, then that nameserver for google.com,then that nameserver for maps.google.com and the last nameserver will then return the needed IP, which will then be returned to the requesting host.

A non-recursive resolver will look in its local domain list and see that it does not have a maps.google.com host, so it just returns an not found error and the host have to figure out to connect to the . nameserver and continue the resolving.

Try to change the nameserver in your router to 1.1.1.1 and the shut it down and the HA host too.
Then start with powering up the router and wait a few minutes and then power up the HA host.

I will do that.

I am surprised though that a misconfigured upstream DNS would break Addons, but still allow me to ping the same host from the consoleā€¦

Tried it, ESPHome still canā€™t resolve github.com, and ping github.com from the host fails too (bad address).

Did you shutdown your HA host (the entire host, not just HA) and your router?

Yes, I did.

Adding 10.42.1.1 to resolv.conf helped the host ping domains (google, GitHub) until the restart., but it didnā€™t help the Addons.

Whatā€™s really confusing me is that 10.42.1.1 is in the network config, but apparently all DNS queries go to 172.30.32.3 anyway?

ha dns info still does the same as before, btw.

172.30.32.3 is internal docker network.
It is probably the router to your 10.42. network.
The problem here is that there is a DNS cache somewhere with the wrong info, which ESPhome use, but you do not.
Normally a complete shutdown of the HA host would have flushed all the DNS catches on that hardware, but you must have a cache somewhere else.