Re-check primary DNS instead of switching permanently to cloudflare in the event of an outage

My setup is that I use pihole for my DNS, and my router to block / forward any request not going through pihole, to pihole itself.

The issue started when I restarted my pihole device. DNS was kicked offline for about 30 seconds. Once this happened, Home Assistant instantly switched over to cloudflare and started spamming my router with over 20,000 requests in 10 seconds. This made my HA CPU spike over 60% permanently, and caused unnecessary network traffic.

My feature request: Why is there not something in place to re-check the primary DNS in the event of an outage? It could simply retry primary DNS and cloudflare at the same time, and see that primary DNS is online again, and prevent going to cloudflare. I did not notice this was happening and only saw it by chance when digging through network traffic.

Surely something can be added to re-check primary DNS and not instantly lock into using cloudflare and causing this loop of endless DNS requests because I am blocking it?

(I am aware you can turn off failover but I still wanted to post this because if code were added to retry primary DNS, this issue wouldn’t have happened because my DNS wasn’t down for very long)

Don’t forget to vote for your own

You will find a lot of details on the matter considering this is an old subject. I think your first thing to do is to read this thread.