I have an asus router with a pi-hole on the network.

I was doing some work on my server and noticed that when pi-hole was down, I couldn’t access the internet. I was looking for some ideas online how to deal with this, but they said to have a second pihole on the network in case one is offline. Is that the only way to do it? Is there any way to have the network go back to normal if the pihole is offline?

59 points

I was doing some work on my server and noticed that when pi-hole was down, I couldn’t access the internet.

You’ve opted to take control over a critical piece of network infrastructure. This is to be expected.

There’s a reason DHCP provides for multiple DNS servers to be listed. Having redundant DNS servers is a common setup. So yes, multiple piholes if you want stability.

permalink
report
reply
31 points

Just wanted to add onto your comment for clarity for others, the multiple servers are not redundancy so much as first come first serve, which is why your comment of multiple pi-holes is important.

If you were to list a pihole and say Google DNS as primary and secondary respectively, you may have some DNS queries responded to by Google. Negating the point of having a pi-hole or similar DNS service locally.

A secondary can be a docker container, another physical pi-hole (even a zero-w, which I personally don’t recommend being your only way to manage DNS, but is fine when you just need to do some maintenance on the primary).

permalink
report
parent
reply
2 points

Could have pihole running on your desktop as a backup

permalink
report
parent
reply
12 points

One option is just do a temporary change on your PC to different DNS servers while you work on the stuff.

Otherwise a second PiHole set as the secondary DNS in DHCP would keep things online.

permalink
report
reply
2 points

Thanks. Yeah, that is what I did during maintenance, but I’m trying to think what happens if I’m gone and my family has issues.

permalink
report
parent
reply
1 point
*

Otherwise a second PiHole set as the secondary DNS in DHCP would keep things online.

No, that just creates time outs and delays when either of them is offline.

The proper way is to have a standby pihole that takes over the IP address of the main pihole when it goes down. It’s quite easy to achieve this with keepalived.

permalink
report
parent
reply
10 points

Not sure if this is common knowledge but Pi-hole can also run in a docker container, it doesn’t have to be a raspberry pi. I have it running on portainer on two different machine in my house. I’m a systems architect by trade so there no kill like overkill 😅

You might be a nerd when you have to schedule maintenance at your own house.

permalink
report
reply
1 point

one a VM, the other a container, with different upstream targets. I have to schedule maintenance when everyone is asleep or out of the house. I’ll swear one day I’ll have a proper (raspberry pi) cluster with KVM, I just need to finish implementing the other million things I find when I research it.

permalink
report
parent
reply
1 point

I totally feel you. I’m in IT and design these incredibly robust systems. But I don’t have that budget for my house and they say “the cobbler’s children have no shoes."

permalink
report
parent
reply
9 points
*

Another trick is setting up a guest/secondary AP that don’t use pi-hole. When your pihole is down, just switch to the secondary AP. Most routers can setup multiple APs, though not all can setup different dns server for the other APs.

permalink
report
reply
1 point

Thanks, that might work. I’ll check into it.

permalink
report
parent
reply
5 points
*

On Mikrotik I have a script that runs every 30sec. If pi-hole not responding, router switches to public cloudflare dns records, otherwise to pi-hole IP.

This setup works like a charm.

P.S. I am using Blocky, but it’s almost the same as Pi-Hole.

EDIT: Since at least 2 guys asked how to do it:

https://forum.mikrotik.com/viewtopic.php?p=866934#p866934

Don’t forget to configure Mikrotik router to act as passthrough DNS server with cache (for performance) and configure DHCP server’s DNS to router’s IP.

permalink
report
reply
3 points
*

That sounds cool. I’ve never messed with scripts on Mikrotik, but would it be possible to share what you have?

I’m guessing a relatively short DHCP lease time is also in play so devices can get the new DNS address? Or do you have Mikrotik set as the DNS server?

permalink
report
parent
reply
2 points

I’ve edited my comment. It contains my used script.

permalink
report
parent
reply
1 point

Thank you, I’ll bookmark it for later.

permalink
report
parent
reply
1 point

Seconding the request to share your work.

That is an amazing idea you’ve come up with that I never considered, but now I need it.

permalink
report
parent
reply
1 point

I’ve edited my comment. It contains my used script.

permalink
report
parent
reply
1 point

Aight, let me do it… 😅

permalink
report
parent
reply
1 point

Thanks, this looks good, but I’m not sure I can do it on Asus. I’ll look into it.

permalink
report
parent
reply

Selfhosted

!selfhosted@lemmy.world

Create post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

Community stats

  • 3.5K

    Monthly active users

  • 3.3K

    Posts

  • 71K

    Comments