Closed Parlendir closed 1 year ago
Hey there @hacf-fr, @quentame, mind taking a look at this issue as it has been labeled with an integration (freebox
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
freebox documentation freebox source (message by IssueLinks)
Looking at the underlying API package that Home Assistant uses, when it open a connection to the API it uses aiohttp.TCPConnector
. Reading the documentation surrounding TCPConnector
, DNS lookups are cached for 10 seconds. After 10 seconds, it would continue the operating system resolver and use the OS cache.
Doing some napkin math, 15 days with a 10 second cache would be roughly 129,600 DNS queries. And that roughly lines up with your number.
Do you know what the TTL is on the DNS record is? If the TTL is longer than 10 seconds, I would expect the operating system cache to kick in and resolve the query from its cache. If the TTL is shorter than 10 seconds, then I believe this is expected due to the way the DNS system is built.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
This integration needs to use a url to find the freebox. So user has to provide the freeboxname.fbxos.fr url given to the box.
This url has to be translated to an ip, with a dns request.
Within 15 days, I got 100k dns requests initiated by this integration. This is a heavy dns hammering imho.
As the box and ha might often be on the same lan, providing the LAN IP address would prevent from flooding the network with dns requests.
What version of Home Assistant Core has the issue?
Docker-2023-1-5
What was the last working version of Home Assistant Core?
None
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Freebox
Link to integration documentation on our website
https://www.home-assistant.io/integrations/freebox/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
There is many easy ways to fix this issue :
Option 1 : put a cooldown on the dns requests Option 2 : add a local cache for the dns answer with a custom ttl Option 3 : add the possibility to put an IP instead of forcing a url to point at the freebox server