• 2025
  • Jun
  • 26

DNS issues with the Home Assistant Green

One of the things I noticed almost immediately after setting up the HA Green unit I purchased was that anything that required Internet - weather cards, electricity useage, devices integration, even logging in - was very flaky and had a lot of dropouts. I wasn’t sure what was going on, but it got to the point where any Internet-enabled integrations were basically unreliable.

This chart is from a YoLink device - HA talks to the YoLink service, and populates data based on what it receives. Notice all the missing data in the middle?

hass-dropouts-wereboar.jpg

That’s time when the card wasn’t available in the overview. This also was corresponding to time when the weather cards and other stuff was not available. Checking the logs, I saw that there was a number of messages about being unable to resolve addresses and failed DNS lookups.

After doing some research on this, I find that the HA container seems to get it’s DNS resolution from a service built in to the HA system itself. It then uses this to populate /etc/resolv.conf with the proper nameservers.

In order to get to that service, you need to access the actual shell of the HA system. You can do this by adding the “Terminal & SSH” add-on from the store. Once that’s installed and started, launch it from the Web UI and type the following:

ha dns info

You’ll get something that looks like this:

fallback: true
host: 172.30.32.3
llmnr: true
locals: - dns://192.168.1.1
mdns: true
servers:

update_available: false
version: 2025.02.0
version_latest: 2025.02.0

Theoretically, it should get DNS from the router (192.168.1.1) like any good device should. But it doesn’t seem to, and this has been broken for a long time from what I can tell.

To insert DNS servers into this file, you’ll need to enter a couple of commands:

ha dns reset
ha dns options --servers dns://8.8.8.8 --servers dns://8.8.4.4
ha dns restart

(I think it should go without saying that you’ll need to be admin or owner to do this.)

Enter as many DNS servers as you like. The example shows Google DNS. Google is Evil in a box, but their DNS does work well, and you’ll probably only need that. I entered a couple more as well just to have some redundancy.

I ended up with this when I was done:

fallback: true
host: 172.30.32.3
llmnr: true
locals: - dns://192.168.1.1
mdns: true
servers:
- dns://8.8.8.8
- dns://8.8.4.4
- dns://9.9.9.9
- dns://1.1.1.1
update_available: false
version: 2025.02.0
version_latest: 2025.02.0

I did do a reboot on the system, just to make sure. After that, /etc/resolv.conf now showed my new DNS servers, where none had existed before. You can check that by going back to the terminal and entering:

cat /etc/resolv.conf

You should see your new DNS servers.

This took care of all of the problems for me - HA now returned the UI much quicker, and no cards are going offline. Will this persist through an upgrade? I don’t know, but my system is in a known state and unless I need some of the new features, I’m not planning on updating with every new version that comes along.

As a note: Some have reported that this did not work for them, so there are certainly other issues at play here. YMMV!

References: https://community.ho … eassistant-os/562041
Original post: https://wereboar.com … ome-assistant-green/