Disable all these useless AAAA requests

Team,

HASS has always these AAAA requests for all (internal-only!) devices. Meaning every minute dozens-and-dozens of requests are coming in on the DNS server - just responding with there is none.

On all systems, IPv6 is disabled at boot time via /etc/sysctl.conf.

What is the use of polling the DNS server every minute asking for AAAA records of all connected devices?

And also - is there a way to disable this as these devices don’t have an IPv6 address?

Cheers - Will

1 Like

I did some more testing. And found out that for every integration Home Assistant is doing an AAAA request for every device. It does this every time it polls for data.

Take for example the TAPO smart plugs - I have changed the poll-rate from 60 seconds to 15 seconds. Now, there is an AAAA request for these devices every 15 seconds. None of these devices support IPv6.

In my case it means that about 40% of all DNS queries are from Home Assistant and its useless AAAA requests. With the new poll-rate of the TAPO devices, this is raised to 56%!!!

While not a real big (technical?) issue, it is a total waste of compute/power resources… would be great if this can be stopped… anyone?

I’m in the same boat. Did you ever find a way to either turn off the AAAA requests or at least get them cached for a while to reduce the load?

It is the way IPv6 is handled.
Either accept it or disable IPv6.
Remember that Matter relies on IPv6 though.

There is no other way unless HA decides to go against the IPv6 standard, which is very unlikely, because it will break functionality for dual stack users, which is a quite common setup today and the usage is rising fast as IPv4 has been depleted.

@ingmarstein :

Yes - I activated a DNS server (i.e. AdGuard) within HASS.
Which is now caching all DNS-requests within the VM.

@WallyR

Huhhh… please elaborate… where does the IPv6 standard says that it should poll devices every 15 seconds? Let alone do this for devices that don’t respond to IPv6 requests?

In addition how do I turn off IPv6 completely? Including the HASS containers and the use of link-local addresses.

I’m not aware of something that turns off ipv6 completely - tried this with HA OS as well as HA Supervised. Even with Supervised and IPv6 turned off via /etc/sysctl.conf there are still several 1000’s IPv6 requests per day - most likely because of the HASS containers.

It does not say when to pull, but to pull for an AAAA address first.
The integration do not know if the device is a IPv4, IPv6 or Dual stack device, so IPv6 is set to always be pulled first.

It is not enough to disable it on HA.
You need to disable IPv6 on all your devices!
The AAAA record is made, so even servers that run on IPv4 networks can resolve IPv6 addresses.

I don’t get it - why run IPv6 in some form or shape if it is disabled on all devices?
Meaning no device will respond to any kind of IPv6 requests.
How can servers resolve IPv6 addresses under these conditions?

It is just the way IPv6 is implemented i order to be able to exist togwther with IPv4.
This way we avoid having to split the internet into an IPv4 and an IPv6 network that can never talk to each other.

If you are right then I have done something wrong since only HASS behaves like this.
All other systems (i.e. Windows & Linux) have IPv6 disabled and only talk IPv4 - nothing else.
I’m actively monitoring this by running a packet analyzer 24x7.

HAOS can be a bitch when trying to manage IPv6.
I have complained about it in several posts.

1 Like

Well - not only for IPv6…

Every 40 seconds(!) it does a calling-home to checkonline.home-assistant.io.
Where each call is with an IPv4 and IPv6 request.

Useless… (at least from my perspective)

You might be able to stop the call, but if the call is made, then it will do an AAAA lookup first and then an A lookup.
This is the way (of IPv6).

I’m also running a local DNS server, so it’s just local AAAA requests, but a lot of them which I’d like to avoid.

The problem is that HA gets NODATA responses each time and does not cache the (negative) result (which has no SOA record in most cases). For integrations with frequent polling, this is generating a lot of unnecessary traffic which could be avoided if the result would be reused for some time.

2 Likes

The problem is that HA gets NODATA responses each time and does not cache the (negative) result (which has no SOA record in most cases). For integrations with frequent polling, this is generating a lot of unnecessary traffic which could be avoided if the result would be reused for some time.

Ideally Home Assistant (or the libraries used by it) should have some minimum caching interval forced for the NODATA or null responses. Or some application-specific layer in between that could be used to help manage these sorts of DNS lookups. It’s not unreasonable to expect an application and/or it’s libraries to honor some caching policies in this regard.

1 Like

Intentional Mandalorian reference?

Well, I wrote the line and realized it. :wink:

Caching will make HA less reactive to changes in your network, which is generally not something you want.

It’s a trade-off which could be configurable. Some may want to request a AAAA record every five seconds just so that it’s picked up quickly whenever it changes. Others may want to accept a five minute delay if that reduces the number of requests by orders of magnitude for something they know will never change.