Selfhosted
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:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
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.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (donβt cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
To me it sounds like you don't have a DHCP problem at all, the issue is no website can be resolved when your DNS is down (PiHole).
You really have two options:
- Make sure the PiHole stays up 24/7, with minor downtime for maybe a reboot or an update.
or
- Setup an additional raspberrypi with PiHole and use gravity-sync to keep them synced. Then, I would run ISC-DHCP server on both the raspberrypi's, one as the primary and the other as the secondary. That way you can specify both of your DNS servers. Make them authoritative and disable your routers DHCP. You can take a look at this guide:
https://stevendiver.com/2020/02/21/isc-dhcp-failover-configuration/
Personally, I like to keep the wife happy so I have option 2 at home, that way the internet never goes down when I tinker.
Edit: Didn't notice you said your router can't issue out two DNS servers. I've never heard of that.
Keepalived (or similar CARP or VRRP virtual IP system) would allow you to run 2 piholes that share the same virtual IP.
If the main goes down, the backup will take over the virtual IP
Lol, this is peak selfhosted. The obvious solution is to get a router/DHCP server that is normal enough to push out two DNS servers.
The selfhosted way is to set of keep alived or a load balancer, because why the fuck not.
Nice, but you don't need this per se. If you have two Piholes doing DNS, one of them can do DHCP and push the two pihole DNS server addresses. If the one with DHCP goes down temporarily you will not get a new addresses, but DNS resolution continues one the one running.
Even if your router can issue two DNS servers you shouldn't add a second that's not a pihole.
Otherwise a client will just fail over any blocked lookups to the secondary, negating the purpose of a pihole.
This would be great except OP said that their router can't push 2 DNS addresses. Otherwise, ya, redundant services is always best
Thanks, didn't notice that. I edited my comment to reflect.
No worries, I had the same thought at first and was very confused for a minute
Edit: Didn't notice you said your router can't issue out two DNS servers. I've never heard of that.
Ugh. When I moved into my new place I bought a NetGear Orbi system to hold me over until I got my Ubiquiti gear put in place. Never again.
Just install 2nd pihole on your synology? You can split DHCP across piholes and a router. Like one can handle IPs from 0 to 100 etc. I have 1 pihole on raspberry, another one on server and DHCP is done on the router.
Usually you can just send a second DNS server by separating the IPs with a comma.
That said, I'm running two PiHoles for the exact reason OP noted. These two PiHoles settings are synced with GravitySync.
If I update one PiHole or it goes down for any reason, the second one is there to pickup the slack.
Regarding DHCP: I'd probably turn off the stupid FritzBox DHCP because you really can't set 2 DNS servers (WTF!) and instead use the PiHole(s) for DHCP.
Thanks.
I think I might try the "pi hole as DHCP" option.
I'd use AdGuard Home for everything.
Second this. I moved from PiHole to AdGH and it's rock solid stable.
If you already have pihole in your environment, I would just use that. DHCP is pretty light weight, so the pi should be more than capable, and you don't want to complicate your core services more than you need to
The ISP router for DHCP (so when DHCP is down, the entire Internet is down and you have a much bigger problem to solve), with the DNS being your Pi-hole server
When the raspberry pi (running pi hole) is down for any reason
You can have 2 DNS servers provided over DHCP assignment, if this is really an issue for you (ideally it shouldnt) you should be running 2x PiHoles for failover protection, that way you can take 1 offline and all devices will auto swap to the second one for DNS.
This will also horizontally scale your DNS querying, as devices will just 50/50 flip flop between the two while both are online and it will sort of auto-load balance.
Largely speaking thats your best bet though, just 2x PiHoles for failover protection.
For DHCP just use one of the pi-holes DHCP, or your routers, or whatever, they all largely perform the same but I personally find the pi-hole's DHCP settings to be easiest to work with (you can even super fast modify them by SSHing in and using nano/vim to text edit the config file, so instead of using a UI you can just copy-paste all the entries in quickly)
If you need to take the DHCP pi-hole offline, you can just flip DHCP on for the second one, however as long as new devices arent connecting you don't actually need the DHCP server online once everyone has an IP assigned until their registration time is up (24 hours by default) so as long as you get the pi-hole back online quickly, you're network typically wont even have a problem.
Get a better router.
Get a better router.