Hassio_dns container keeps restarting, can't access external services

I have problem with dicker container hassio_dns keep constantly restarting and in logs there is lot of CoreDNS fails. I think this can cause my other problems like unknow weather in default widget.

I’m using Raspberry Pi 4 4Gb with fresh installed Rasbian 64bit. I installed Home Assistant using this script curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" | bash -s -- -m raspberrypi4-64

Docker hassio_dns container keeps restarting docker ps -a

CONTAINER ID        IMAGE                                                 COMMAND                  CREATED             STATUS                       PORTS                                            NAMES
02a4ee0de78b        homeassistant/aarch64-hassio-dns:1                    "coredns -conf /conf…"   10 seconds ago      Exited (159) 7 seconds ago                                                    hassio_dns

Logs from Home Assistant > Supervisor > System

20-02-11 17:53:47 WARNING (MainThread) [hassio.tasks] Watchdog found a problem with CoreDNS plugin!
20-02-11 17:53:47 WARNING (MainThread) [hassio.tasks] CoreDNS plugin is in fails state / Reset config
20-02-11 17:53:47 INFO (MainThread) [hassio.dns] Start CoreDNS plugin
20-02-11 17:53:47 INFO (SyncWorker_7) [hassio.docker.interface] Clean hassio_dns application
20-02-11 17:53:48 INFO (SyncWorker_7) [hassio.docker.dns] Start DNS homeassistant/aarch64-hassio-dns with version 1 - 172.30.32.3

Logs from Log viewer

2020-02-11 22:06:02 ERROR (MainThread) [metno] https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/ returned Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:06:02 ERROR (MainThread) [homeassistant.components.met.weather] Retrying in 17 minutes
2020-02-11 22:22:02 ERROR (MainThread) [homeassistant.components.yr.sensor] Retrying in 16 minutes: Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:23:08 ERROR (MainThread) [metno] https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/ returned Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:23:08 ERROR (MainThread) [homeassistant.components.met.weather] Retrying in 16 minutes
2020-02-11 22:38:08 ERROR (MainThread) [homeassistant.components.yr.sensor] Retrying in 18 minutes: Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:39:14 ERROR (MainThread) [metno] https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/ returned Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:39:14 ERROR (MainThread) [homeassistant.components.met.weather] Retrying in 15 minutes
2020-02-11 22:06:02 ERROR (MainThread) [metno] https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/ returned Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:06:02 ERROR (MainThread) [homeassistant.components.met.weather] Retrying in 17 minutes
2020-02-11 22:22:02 ERROR (MainThread) [homeassistant.components.yr.sensor] Retrying in 16 minutes: Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:23:08 ERROR (MainThread) [metno] https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/ returned Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:23:08 ERROR (MainThread) [homeassistant.components.met.weather] Retrying in 16 minutes
2020-02-11 22:38:08 ERROR (MainThread) [homeassistant.components.yr.sensor] Retrying in 18 minutes: Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:39:14 ERROR (MainThread) [metno] https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/ returned Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
2020-02-11 22:39:14 ERROR (MainThread) [homeassistant.components.met.weather] Retrying in 15 minutes

I can’t reach google from homeassistant container

pi@raspberrypi:~ $ docker exec -it homeassistant /bin/bash                                   
                                                   
bash-5.0# ping google.com                 
ping: bad address 'google.com'                 
bash-5.0# dig google.com                                                
     
; <<>> DiG 9.14.8 <<>> google.com    
;; global options: +cmd                            
;; connection timed out; no servers could be reached

But without any problem i can reach it from hassio_supervisor container

pi@raspberrypi:~ $ docker exec -it hassio_supervisor /bin/bash
bash-5.0# ping google.com
PING google.com (172.217.20.206): 56 data bytes
64 bytes from 172.217.20.206: seq=0 ttl=55 time=43.374 ms

Output from hassio dns info

host: 172.30.32.3
latest_version: "1"
locals:
- dns://192.168.1.1
servers: []
version: "1"

I tried to change dns by hassio dns options --servers dns://1.1.1.1 but it didn’t help and after short time new DNS server disapear from servers list.

I have read other similar threads on the forum but I have not found any working solution.

I’m having the same issue.

I thought it was a DNS issue with my router giving the pi-hole address out as the dns server. I removed requesting the dns server from the dhcp config on the host, but it didn’t help.

Same problem, I’ve changed in /etc/resolv.conf from

search local.hass.io
nameserver 127.0.0.11
options ndots:0

to just nameserver 1.1.1.1 and at least I can ping from hassos, but still can’t access external services (Volvo On Call, CoronaVirus, Weather etc.)

Also I got this strange error when doing ha dns logs

~ $ ha dns logs
/config/corefile:16 - Error during parsing: Unknown directive 'fallback'

There is no corefile in whole system…

I have the exact same issue. The hassio_dns doesn’t even start due to this error. This causes all internal DNS resolutions within Hassio to fail.

I don’t even remember making any changes to the hassio or any other service. It just started appearing randomly. Anyone have any leads as to why this must be happening?

A solution I found is to run the following command in the SSH add-on.

ha dns update
1 Like

Thank you for advice, however command ended up like this on my installation

~ $ ha dns  update
Processing... Done.

Error: Version 3 is already in use

At least I don’t see errors in dns logs, and can see some queries

[INFO] 172.30.32.1:50497 - 65247 "A IN www.gdacs.org. udp 31 false 512" NOERROR qr,rd,ra 92 0.016439967s
[INFO] 172.30.32.1:50497 - 1119 "AAAA IN www.gdacs.org. udp 31 false 512" NOERROR qr,rd,ra 135 0.017442462s
[INFO] 172.30.32.1:50122 - 40709 "AAAA IN vocapi.wirelesscar.net. udp 40 false 512" NOERROR qr,rd,ra 129 0.038604602s
[INFO] 172.30.32.1:50122 - 39824 "A IN vocapi.wirelesscar.net. udp 40 false 512" NOERROR qr,rd,ra 78 0.038756788s
[INFO] 172.30.32.1:45699 - 22823 "A IN vocapi.wirelesscar.net. udp 40 false 512" NOERROR qr,rd,ra 78 0.016211234s
[INFO] 172.30.32.1:45699 - 23708 "AAAA IN vocapi.wirelesscar.net. udp 40 false 512" NOERROR qr,rd,ra 129 0.038177374s
[INFO] 172.30.32.1:35914 - 29004 "AAAA IN vocapi.wirelesscar.net. udp 40 false 512" NOERROR qr,rd,ra 129 0.015642596s
[INFO] 172.30.32.1:35914 - 28170 "A IN vocapi.wirelesscar.net. udp 40 false 512" NOERROR qr,rd,ra 78 0.015930146s

But still most external services arent working.

Thanks. I was having the same issue all of a sudden. This command and setting dns server to my router fixed the issue for me.

ha dns options --servers dns://192.168.1.1

could you show ha dns info and content of your /etc/hosts fille?

I’ve got host 172.30.32.3 in dns info

~ $ ha dns info
host: 172.30.32.3
locals:
- dns://1.1.1.1
- dns://8.8.8.8
servers: []
version: "3"
version_latest: "3"

but 172.30.32.2 in hosts, IDK if this was like that always, or something broke during update to 0.107.x or newer supervisor

~ $ cat /etc/hosts
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.30.32.2     hassio
172.30.32.2     supervisor
172.30.33.2     core-ssh.local.hass.io core-ssh

Sure.

~ $ ha dns info
host: 172.30.32.3
locals: []
servers:
- dns://192.168.1.1
version: "3"
version_latest: "3"
~ $ cat /etc/hosts
127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
172.30.32.2	hassio
172.30.32.2	supervisor
172.30.33.2	core-ssh.local.hass.io core-ssh

hmm, same as mine. So local DNS instead of public one is no fix for me :confused:

Same problem here. Internet is reachable ping 8.8.8.8, but DNS resolving is not working. When setting a DNS server with ha dns options --servers it is removed after a few seconds. servers: [] is then cleared, is this normal?

Changing the resolv.conf towards a DNS server gives me the option to resolve domains also to the internet but still all application within HASSIO do not work that rely on internet connectivity.

~ $ ha dns info
host: 172.30.32.3
locals:

  • dns://8.8.8.8
    servers: []
    version: “3”
    version_latest: “3”

I managed to resolve this on my Synology NAS with docker.

Similar issue here but I do not have any DNS server at all:

~ $ ha dns info
host: 172.30.32.3
locals: []
servers: []
version: "9"
version_latest: "9"

Using the ha dns options --servers command sets the DNS server only for a few seconds, then it reverts back to the above. Tried everything that came up searching.

The /etc/resolve.conf file is an auto generated file. So editing will never work. It’s generated from files in /etc/resolvconf/ you should look in this directory to see what’s in it. If you have or had multiple DNS software on your system it’s possible some files are left in there with the wrong data in it. If you only have resolveconf then it’s probably set only in /etc/resolvconf/resolv.conf.d/base. In that file should be something like

nameserver 8.8.8.8
nameserver 1.1.1.1

If that file is there /etc/resolve.conf should be made up from it and those nameservers should be used in it.

This is what I read in the first hit on Google. So it could be wrong also. But it kinda made sense.

Thanks for the tip.
I tried adding them to the base file and did get the servers to show up in /etc/resolve.conf.
After ha dns restart they still don’t show up.

Puntoboy:
can you expand on how you manually created the container?
I created one and it died alongside the original one.
I’ve never used docker and I suspect parameters or options are needed in the commands.
Also, hassio just keeps creating its own possibly leading to conflicts.

I’m not sure really sure how to expand. IIRC I just downloaded the newer version of the image “homeassistant/amd64-hassio-dns with version 3” that was being called for in the logs. For some reason the one deployed with the other containers was an earlier version. Once I downloaded that image I created a new container and that was it. I haven’t touched it since.

Thanks. None of this worked so I’m uninstalling Home Assistant. I don’t need to fill my SD card with endless error logs. I’ll reconsider in the fall when I’ll need the limited functionality that I have now.
Whether the problem is in Home Assistant or Docker I wasted enough of my life trying to get this to work.
Docker, apparently, is beyond my comprehension but I’ve been using linux off and on since 1996 and this is by far the toughest bug I’ve ever seen.

How to remove those dns settings that are defined under the locals sections?

Hi, I have got the same problem. Hassio_dns container starts, is immediatelly killed and after some time it is recreated and the whole process repeats.
d66fd7e4b9d9 homeassistant/aarch64-hassio-dns:2021.01.0 "/init" 5 seconds ago Exited (159) 3 seconds ago hassio_dns

I have tried to find the solution everywhere but no luck. Anybody knows where the problem might be?