Name resolution problem since 0.97.2

–nevermind- reverted back to plain HA

I was sometimes getting this error message Permission denied: '/etc/resolv.conf' but then my hassio has never managed to resolve ‘.local’ addresses on my network.

Dude… this had me trippin for a few days! I have my home router (pfSense) block all outbound DNS request. My router runs a resover and forces all queries over TLS to 1.1.1.1 or Quad9. When my hassio supervisor auto-updated hass lost all ability to resolve hosts!

I realize I am probably an edge case, but is there a way to notify users of a “breaking change” like this before it auto-applies?

I have a similar problem to this but the resolution works fine. What I’m curious about is the sheer amount of DNS queries being made by my HA instance running through Hassio on an RPi. It keeps making queries for domains with in-addr.arpa in the name. For example:
42.1.168.192.in-addr.arpa
The queries are relentless and I’m not sure where to start to try and debug this.

Edit: Apparently this isn’t an issue per this GitHub issue, but it’s very odd that the spike started all of a sudden considering it wasn’t happening before.

They are reverse dns lookups.

There is a feature request for blocking supervisor auto-updates. If you dont like the auto-update machanism vote against it here: Feature request: block supervisor auto-updates

1 Like

For a general user with external DNS, I can understand that there’s going to be a lot of “NXDOMAIN” responses, but my system’s setup with an internal DNS, DHCP, etc and knows that “.home” doesn’t exist.

From an external DNS point of view, that’s true (& I agree), but internally, with my own DNS server and everything using a DNS Suffix searchlist of “.home” means that I can use “devicename” and it still resolves to the correct IP.

Using avahi and “.local” is great for those that don’t have any networking experience and / or want to just have everything automatically find everything else and that’s great for a system like this, but that’s not how I run my network (and this is a debate for another place).

So, from my point of view, you’re implementing avahi… cool, that’s the project’s choice… now, I just want to disable / bypass / use my own DNS for my system…

So, I’m just looking for options in the project here… the system can arrive pre-configured but I’d like to switch to “advanced mode” and change the defaults :slight_smile:

If that’s in an new “networking.yaml” (for example), or a webGUI page, that’s cool… command line’s less desirable, but if that gets me setup, then that’s what I’ll do.

1 Like

How to reset the dns configuration?

I’m on supervisor 184 and I think now it should be working. I changed my hostname to fqdn (even though I concur that it never was and should not be necessary), but it still not able to resolve the hassio official MariaDB addon.

Here’s the output of the command
image

It seems to resolve correctly, but then I guess the SERVFAIL somehow messes things because the recorder cannot connect to the database.

Thanks

What a terrible design. Why is it so incredibly difficult to set something as simple as a DNS resolver? I just installed Hass.io via Debian/Docker and I have wasted so much time trying to figure out how to set my own resolver, and even after reading this thread I am completely lost.

Something so rudimentary shouldn’t be so ridiculously difficult. Please fix this.

2 Likes

Running hass.io in Docker on Ubuntu; my hassio_dns docker container can resolve short names on my network with no issue (I removed all other dns besides 192.168.1.1 from /usr/share/hassio/dns/corefile); however my homeassistant container can not resolve any local addresses not in the hassio_dns container’s hosts file, internet addresses are okay.

The only way I can seem to get this working properly is to go into nuke search from homeassistant container’s /etc/resolv.conf…

docker exec -it homeassistant bash -c 'cp /etc/resolv.conf /tmp/resolv.conf.old; grep -v search /tmp/resolv.conf.old > /etc/resolv.conf'

However I can’t figure out how to persist that change across restarts.

@dogcow

Did you both read the link here Name resolution problem since 0.97.2

I don’t know about dogcow, but I read it… doesn’t help me at all… I don’t have a ‘hassio’ command, and even if I did it still doesn’t address that the dns search base doesn’t allow for resolving local names not residing in the .hass.io name space, for which none of the devices on my lan live in outside of the hassio_* docker containers are.

If you’re running hassio you have the command if you install the community ssh addon. I added my local router to dns and it resolves local network devices.

I’m running hassio in containers, I don’t have a hassio command… not in the host, not in the homeassistant container, not in the hassio-supervisor, not in hassio-dns…

g@h:/usr/share/hassio/homeassistant$ docker ps
CONTAINER ID        IMAGE                                           COMMAND                  CREATED             STATUS              PORTS               NAMES
f1cff7445a5f        homeassistant/qemux86-64-homeassistant:0.98.2   "/bin/entry.sh pytho…"   9 hours ago         Up 8 hours                              homeassistant
4374aa0705ef        homeassistant/amd64-addon-duckdns:1.10          "/run.sh"                10 hours ago        Up 10 hours                             addon_core_duckdns
057584be9b07        homeassistant/amd64-hassio-supervisor           "/bin/entry.sh pytho…"   43 hours ago        Up 8 hours                              hassio_supervisor
eecd515ed772        sketchup                                        "/usr/local/bin/run-…"   3 days ago          Up 3 days                               hardcore_napier
8c51feebc8aa        hassioaddons/log-viewer-amd64:0.6.3             "/init"                  5 days ago          Up 5 days                               addon_a0d7b954_logviewer
b1118968e9ad        hassioaddons/vscode-amd64:0.6.5                 "/init"                  5 days ago          Up 5 days                               addon_a0d7b954_vscode
195bdf99551e        homeassistant/amd64-hassio-dns:1                "coredns -conf /conf…"   5 days ago          Up 8 hours                              hassio_dns
g@h:/usr/share/hassio/homeassistant$ hassio
hassio: command not found
g@h:/usr/share/hassio/homeassistant$ docker exec -it homeassistant bash
bash-5.0# hassio
bash: hassio: command not found
bash-5.0# exit
g@h:/usr/share/hassio/homeassistant$ docker exec -it hassio_supervisor bash
bash-5.0# hassio
bash: hassio: command not found
bash-5.0# exit
...

Where does it reside?

Forget the hack I wrote above…

Making the following command (which must run each time the container starts) into a persistent change is the correct way to resolve this issue:

 docker exec -it homeassistant bash -c 'echo "options ndots:0" >> /etc/resolv.conf'

That tells dns to search names that are lacking “.” locally before forwarding to outside DNS.

I take it these errors are also related:

9-09-06 10:37:41 ERROR (MainThread) [hassio.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].
19-09-06 10:37:41 INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
19-09-06 10:37:41 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_appdaemon3
19-09-06 10:37:41 ERROR (MainThread) [hassio.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].
19-09-06 10:37:46 INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
19-09-06 10:37:46 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
19-09-06 10:37:46 ERROR (MainThread) [hassio.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].
19-09-06 10:37:46 INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
19-09-06 10:37:46 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_appdaemon3
19-09-06 10:37:46 ERROR (MainThread) [hassio.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].

all addons work for me, except mariadb.

I didn’t see any DNS errors there.

Thanks. Sorry if I was a bit harsh on my initial post, but to be fair [my opinion is] that it is a little crazy one has to

a) somehow learn that a third-party plugin is required to have the tools necessary to change DNS settings, considering it is not documented anywhere that I could find (sans a few obscure forum posts)

b) actually install and configure that plugin

c) finally get it working and have the ability to update DNS.

I’m not a dev, so all I can do is comment on what the end-user experience is like.

Please note: I am not trying to be negative; I want Home Assistant to be awesome (because it already is - I’m just getting started and WOW this is neat!)

So in case someone comes looking via a search engine: If you have a Hass instance and need to set your own DNS resolver, first install the “SSH & Web Terminal” third-party add-on (this gives you the hassio command that is necessary in the next step), configure it and get it working, then run the command hassio dns options --servers dns://IP_ADDRESS

Cheers!

1 Like

You could also use the core ssh addon… so not 3rd party. You can’t even bring up a terminal unless you install ssh.

But that’s not so different to anything else in Home Assistant is it? Adding integrations, adding custom components adding addons - all provide different functionality.

I believe the dns container was introduced to fix a lot of DNS problems people seem to have previously. Yes it was a poor initial implementation - but they didn’t expect that to happen and when it did cause issues they moved pretty quickly to fix it.

On my system I have not needed to add my own DNS to the dns options since they fixed it and I suspect most people won’t. Perhaps even you don’t. I did find after changing the DNS that it takes time for everything to start working properly again.

Anyway glad you sorted it out!

JUst ran into same issue … dns issue aftter auto upgrade supervisor to 187 … downgrading fails the way that the supervisor will be updated automatically each time on reboot or in running instance
I run hassio on intel-nuc …Docker… any ideas how to solve this again ?? Took me hours to setup hass and then this… ugly … :confused: