What's new

DNS fallback if Pihole fails

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Phil Mcavity

Occasional Visitor
Ive been trying to figure out how to keep my network up if Pihole goes down , without having to run two Piholes. There are various threads scattered about the forums but there dosent seem to be a definite answer.
I wondered if anyone has figured this out yet...
My set up

1681038155654.png


1681038222790.png


1681038468662.png
 
I have thought about it but have not tried it yet.
First you need something on the router to check the DNS server periodically.
One solution would be switching the DNS listed for DHCP and restarting the services. Problem would be that devices will not get that immediately and keep trying the failed DNS.

My other idea was to somehow get the router to also listen for DNS on 192.168.1.2, and then make the second DNS in the DHCP 192.168.1.2. Then you again need something to check the local DNS and if its working you take the .2 IP offline, all devices should use the local DNS. If the local DNS fails you bring the .2 IP online and the devices should start using that.

Not sure if having the second DNS in there always dead will cause occasional delays?
 
My set up

You can get some redundancy in exchange of some DNS requests going around your Pi-Hole:

DNS in LAN set to 192.168.1.32 with router IP advertisement enabled
DNS Director has to be disabled
DNS in WAN set to first DNS 192.168.1.32 and second DNS 149.112.112.112
DoT in WAN has to be disabled

In this configuration most requests will go through Pi-Hole (and even more when it builds the cache and starts replying faster) and through Quad9 when the Pi-Hole is not available. The delay is about 1 second when your DNS server goes down.
 
@Tech9 thats an interesting set up thanks. Idealy I would like all requests to go through the Pihole hence DNS Directer enabled , but I will test your set up
 
Last edited:
Ideally you run Pi-hole on something more reliable than RPi with SD Card. Used HP Mini, Dell Micro, Lenovo Tiny sometimes come cheaper than RPi kit on eBay and offer greater reliability and much more processing power (and software options available) with under 20W power consumption.
 
If you really, truly, need it, then take 2.

That's always been good advice. I run an adblocker on a Rpi 4b and another one on a VM on my desktop / media server that's always on (using Adguard home now, but was the same when I was using pihole). Other option is to run Adguard home right on the router, that way all your 'single points of failure' are combined.
 
If on the router - SSD in external USB enclosure to avoid the same potential flash storage issue. Last time I tested AdGuard Home on the router I was using 32GB SanDisk Ultra Flair drive and this thing almost burned my fingers heating up to 62C. I don't expect it to last for very long running that hot. The same drive with Ubuntu Server installed on it lasted for 4 days and failed. Perhaps common overheating failure many USB sticks suffer from.
 
The other thing to note, use Raspberry's excellent SD cloning feature if you do you an SD drive. Have a spare ready to go in no time if you do lose one. I've had the same 2 SD cards for 2 years, no issues. But I use a proper power supply on the 4B and that's supposed to make a difference as well (as well as using quality name brand SD cards).

Good luck :)
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top