this post was submitted on 11 Jul 2023
20 points (95.5% liked)

Selfhosted

40492 readers
183 users here now

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!

founded 2 years ago
MODERATORS
 

Hello everyone,

first time ever posting on lemmy, feels good πŸ˜‰

I have a question regarding DHCP in my local network.

My current setup is as follows:

  • DHCP provided by router (Fritz!Box 7490)
  • DNS provided by pi-hole hosted on a raspberry pi
  • DHCP pushes the IP of the raspberry via DHCP to all clients

My problem is: When the raspberry pi (running pi hole) is down for any reason, none of my devices has internet access anymore. This is due to the fact that the Fritz!Box router (aka DHCP server) has no option to push a secondary DNS as a fallback to its clients.

One option would be to buy another router which has the option to push a secondary DNS, which I would prefer to avoid, since otherwise I am happy with the Fritz!Box.

So I am looking for alternative configurations with my existing hardware. I could for example use pi holes DHCP. Or I could use the DHCP server package of a synology NAS which is also part of my local network. Or is there another option, maybe using some DHCP service on the raspberry pi or in a docker container or something like that? Does anyone have experience with one of these setups and can tell me if it is possible to provide the clients with two (prioritized) DNS options? What would you recommend? Thanks!

you are viewing a single comment's thread
view the rest of the comments
[–] notdeadyet@lemmy.dbzer0.com 10 points 1 year ago* (last edited 1 year ago) (4 children)

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:

  1. Make sure the PiHole stays up 24/7, with minor downtime for maybe a reboot or an update.

or

  1. 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.

[–] towerful@programming.dev 4 points 1 year ago (2 children)

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

[–] pete@lemmy.world 5 points 1 year ago

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.

[–] nsaobserverbot@kbin.social 3 points 1 year ago

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.

[–] h0rnman@lemmy.world 3 points 1 year ago (1 children)

This would be great except OP said that their router can't push 2 DNS addresses. Otherwise, ya, redundant services is always best

[–] notdeadyet@lemmy.dbzer0.com 2 points 1 year ago (1 children)

Thanks, didn't notice that. I edited my comment to reflect.

[–] h0rnman@lemmy.world 2 points 1 year ago

No worries, I had the same thought at first and was very confused for a minute

[–] lando55@lemmy.world 1 points 1 year ago

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.