Very high CPU usage for CoreDNS

I’ve been running HA in an ESXi virtual machine now for about 8 months without a problem but about two weeks ago I noticed that the server was experiencing higher than usual load and I finally got around to looking into it and found that the culprit is my HA instance which had unusually high CPU usage.

So I checked with top to see the processes and which might be using the CPU and it turns out it’s CoreDNS that has CPU usage between 50-100%

This just randomly seems to have happened. I did not do any updates at the time when the CPU usage increased, but I have since then updated both HA Core and OS (yesterday) without any effect.

Any tips on how to fix this or further troubleshooting I should do?
I am very unfamiliar with CoreDNS so am a bit lost as to where to start

Turns out it was the fallback configuration for coreDNS that had kicked in and it constantly tried to connect to Cloudflare DNS which is prevented by my firewall.
Disabling the fallback feature fixed this issue. Command for disabling it is: ha dns options --fallback=false

Also a big thank you to the redditor /u/tallr0b which pointed me to this thread Improve Privacy, Stop using hardcoded DNS which gave me the solution.

3 Likes

Root Cause Info: High CPU load hassio_dns Container - #15 by d0nni3q84

Thank you!!! Still a problem a year and a half after… just ran into this as I moved HA into a proxmox VM.

Same issue here, after moving HA to a Proxmox VM. Solved by issuing the mentioned command. Thanks !

Ive never had this issue and all of a sudden today this started to occur. I am also running HAOS on proxmox VM

I have this issue too, not sure how long ago it started. Running current version of HA, on a RaPi4.

Took a long time to track down what was using the CPU.

The ha dns options --fallback=false fix worked for me.