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!

  • notdeadyet@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    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.

    • h0rnman@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      OP already said that their current DHCP solution (the router) can’t push multiple DNS servers. Having a good secondary can be really helpful for things like power blips, maintenance windows, and cats pulling power cables. There are a few solutions that also do ad blocking that can make good secondaries

      • PineapplePartisan@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 year ago

        I don’t think anyone is arguing against dual DNS servers. The distinction being made is that a second DNS server is not a fallback. Most newbies think “secondary” means it will only be used when the primary is unavailable. That’s not true. A client is just as likely to use a secondary DNS as a primary. If only one DNS uses pihole, then the secondary will serve ads because it’s just calling the upstream DNS resolver.

        Personally, I accomplished what OP is talking about with two rPis. First serves DCHP from 192.168.1.10 to .100, second serves .101 to .250. I send the two piholes as primary and secondary DNS. I also use Unbound as the upstream, but that is just personal preference.

    • Andi@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Second this. I moved from PiHole to AdGH and it’s rock solid stable.