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?

  • @FanchFilingCabinet@lemy.lol
    link
    fedilink
    English
    3
    edit-2
    1 year ago

    You mentioned you have an Asus router. Which one? Why not move to hosting your stuff on the router? https://www.snbforums.com/forums/asuswrt-merlin.42/ Sure it doesn’t completely solve the issue but in my experience it’s incredibly stable, and more so people expect to restart the router if the Internet isn’t working which simplifies things too. Also beneficial is that you can give different clients different DNS servers comfortably.

    Specifically, check out https://diversion.ch/ for dns blocking but its capable of a lot more.

    • @machinin@lemmy.worldOP
      link
      fedilink
      English
      21 year ago

      Unfortunately, I don’t think my router is compatible with Merlin.

      Thank you, though, I appreciate the feedback.

  • @HybridSarcasm@lemmy.worldM
    link
    fedilink
    English
    01 year ago

    Add another DNS server (1.1.1.1, for instance) to your DHCP options. Your DHCP clients will use 1.1.1.1 when the pi-hole isn’t responsive.

  • @redcalcium@lemmy.institute
    link
    fedilink
    English
    9
    edit-2
    1 year ago

    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.

  • @bartolomeo@suppo.fi
    link
    fedilink
    English
    11 year ago

    Does it work if you change your DNS server by editing /etc/resolv.conf and having it show exactly one name server like

    nameserver 9.9.9.9

    ?

  • @BearOfaTime@lemm.ee
    link
    fedilink
    English
    -41 year ago

    Umm, yea, if your DNS server is offline, how do your machines know how to resolve DNS names to IP addresses?

    Which is why IP config has the capability for multiple DNS servers.

    If this is surprising, you may wanna read up on your networking.

    • @Sanguine@lemmy.world
      link
      fedilink
      English
      131 year ago

      Why the extra snark? This person is asking a question. Easy to argue that he is trying to learn more about networking, why ostracize?

    • Altima NEO
      link
      fedilink
      English
      101 year ago

      I think he realized that, he’s looking for a solution though.

    • @machinin@lemmy.worldOP
      link
      fedilink
      English
      11 year ago

      Thanks, I see that is the common recommendation. I also have to think what to do if I’m away and the family has issues.

      I appreciate the response.

  • @WindowsEnjoyer@sh.itjust.works
    link
    fedilink
    English
    6
    edit-2
    1 year ago

    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.

  • @Decronym@lemmy.decronym.xyzB
    link
    fedilink
    English
    1
    edit-2
    1 year ago

    Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

    Fewer Letters More Letters
    AP WiFi Access Point
    DNS Domain Name Service/System
    HA Home Assistant automation software
    ~ High Availability
    IP Internet Protocol
    LXC Linux Containers
    PiHole Network-wide ad-blocker (DNS sinkhole)

    6 acronyms in this thread; the most compressed thread commented on today has 3 acronyms.

    [Thread #481 for this sub, first seen 4th Feb 2024, 14:35] [FAQ] [Full list] [Contact] [Source code]

  • Possibly linux
    link
    fedilink
    English
    -5
    edit-2
    1 year ago

    What are you asking? It sounds like you need some sort of HA (high availability)

  • @atzanteol@sh.itjust.works
    link
    fedilink
    English
    601 year ago

    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.

  • @MangoPenguin@lemmy.blahaj.zone
    link
    fedilink
    English
    121 year ago

    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.

    • DefederateLemmyMl
      link
      fedilink
      English
      1
      edit-2
      1 year ago

      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.

    • @machinin@lemmy.worldOP
      link
      fedilink
      English
      21 year ago

      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.

  • Bizarroland
    link
    fedilink
    -21 year ago

    If you’re router has a failover DNS option, usually listed as DNS 2, I would set something like quad 9 as your backup DNS. Address is 9.9.9.9.

    If you don’t want to do that, then having a second instance of pihole running as the secondary DNS is pretty much your only good option

    • Andi
      link
      fedilink
      English
      71 year ago

      That’s not how the two entries for DNS works. Devices will use both rather randomly, and therefore some requests will not be filtered.

      The best way is to run two instances for redundancy.

      • Bizarroland
        link
        fedilink
        -31 year ago

        Can you send me some more information on this because this is the first I’ve ever heard that it would not automatically pick the fastest closest and most responsive DNS system available.

        No remote DNS server will ever be as fast as one that is local

        • @Pete90@feddit.de
          link
          fedilink
          English
          71 year ago

          I tried this. Put a DNS override for Google.com for one but not the other Adguard instance. Then did a DNS lookup and the answer (ip) changed randomly form the correct one to the one I used for the override. I’m assuming the same goes for the scenario with the l public DNS as well. In any case, the response delay should be similar, since the local pi hole instance has to contact the upstream DNS server anyway.

      • Bizarroland
        link
        fedilink
        -51 year ago

        Yeah, looks like you don’t know what you’re talking about.

        The second ipv4 DNS address is for redundancy and every network connected system will use the first one as long as it responds.

        It’s perfectly fine to have a single pihole and use something like quad9 as a failover in the unlikely event that your pihole goes down unexpectedly.

        • Andi
          link
          fedilink
          English
          21 year ago

          Run two and check the logs. You’ll see about 20% of your requests will log on the second instance. So currently, that’s 20% of your DNS requests not being filtered.

          You’ll also find some devices just latch on the the second and never use the first - again, in your scenario, these are not being filtered.

          • BarbecueCowboy
            link
            fedilink
            11 year ago

            I can back this up with experience.

            I’m actively running two piholes for years now. About 2/3rds of my traffic does go to the primary and some seem to ‘lock on’ to using just one, but most devices will swap between the two at their leisure.

        • Encrypt-Keeper
          link
          fedilink
          English
          6
          edit-2
          1 year ago

          Actually they do know what they’re talking about. Configuring DHCP with multiple DNS servers isn’t for failover, it’s for redundancy. The result is ultimately operating system dependent, but modern Windows operating systems will query all configured DNS servers in parallel and will accept the first answer it receives. So if you configure your Pihole as one DNS server and a public DNS server as a second, a lot of your traffic will just bypass your Pihole ad filtering entirely.

          • Bizarroland
            link
            fedilink
            -41 year ago

            Proof?

            I read 15 different sites about DNS and not a one of them claimed anything like this. They universally all stated that your network attached devices would use the 1st one unless it didn’t respond and only use the 2nd one if the 1st one did not.

            So once again, I ask “Can you send me some more information on this” and not just claim it without any backup information?

            I apologize if I am coming off rude, just my BS meter is getting close to the red zone and I would really appreciate some reliable evidence.

            • Encrypt-Keeper
              link
              fedilink
              English
              71 year ago

              The best proof would be to just try it yourself and see what happens. Load up Wireshark, make a query, and look at your traffic. Because the problem is there isn’t a single technical article I can point you to that details exactly how DNS resolution works on every device running any given operating system. “Network attached devices” could be anything and so you can’t be certain exactly how each device will operate.

              I’ll give you that in the case of Windows devices specifically, Microsoft isn’t good at keeping documentation up to date, and on older version of windows it used to work the way you describe. It would send the request to your first DNS server, wait one second for a response, and only if it didn’t get one would it move on to your next one. However in Windows 10 today if I edit my configuration so that I use a local DNS server located at 192.168.69.210 as my “Preferred” DNS server and 1.1.1.1 as my “Alternate” DNS server look what happens:

              It sends the same request out to both without waiting and the response from Cloudflare actually comes in before the one from my local DNS server. So if this were a request for a blocked domain, the client would accept the response from Cloudflare because it was received first and so the request wouldn’t be blocked.

            • @B0rax@feddit.de
              link
              fedilink
              English
              2
              edit-2
              1 year ago

              If what you said was true, my secondary Pi-hole wouldn’t have to respond to any queries. But it in fact gets quite a lot of them. As the other poster has said, it is about 80/20 for 1st and 2nd pihole. Sometimes the ratios are different, depending on the time of day (don’t ask me why….).

  • Rose56
    link
    fedilink
    English
    21 year ago

    ssh into your pi-hole if possible and try using commands systemctl status pihole-FTL Check the status, and if its disabled use the same command but with start instead of status. Also if this this your first time setup, double check that everything you did is correct, like the DNS setting on router, if the devices get the right DNS etc.

    • @machinin@lemmy.worldOP
      link
      fedilink
      English
      21 year ago

      Sorry for the confusion, but everything was working fine, I just had to update the server my pi-hole docker container was hosted on and noticed that I lost access to the internet. It works beautifully when the container is up and running.