Every month or so all my devices lose internet and the only way to connect them all back is to disconnect them from the DNS server that Pihole is running.

I set my Pihole to have a static IP but for some reason after around a month or maybe longer, it just fails. This has happened 4 times over the last while and the only fix is to essentially uninstall everything on my Pihole, disable it, and then reconfigure it from scratch again.

I’m not sure what’s going on so any help would be appreciated.

    • PerogiBoi@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      10
      ·
      edit-2
      2 年前

      That’s a good idea that I hadn’t considered. I’ll see if I can get Pihole running on an old android phone I have lying around.

      Edit: I now have PiHole running on an old Pixel 3a and have decommissioned my PiHole docker container on my home server.

      • Gooey0210@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 年前

        My server and a raspberry are running adguard home

        Both have autoupdate with autoreboot. If I need to change something, connect, disconnected, everything will continue working

      • nbafantest@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 年前

        I have a google router and It allows me to enter 2 DNS servers incase the first DNS Server doesnt work.

        • stown@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          2 年前

          That’s pretty standard for nearly every router and Internet connected device. There is almost always a setting for Primary and Secondary DNS servers. Sometimes you can even set more (ie. 2 IPv6 DNS servers in addition to the 2 IPv4 DNS servers)

      • floofloof@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 年前

        Or gravity-sync. I use two Pi-holes with gravity-sync and it’s very reliable and effortless.

    • Limit@lemm.ee
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 年前

      I run pihole on a proxmox cluster (lxc containers), 2 separate IPs and I setup keepalived and made the virtual IP the primary dns ip that my dhcp server hands out, pihole1 is the master and pihole2 secondary. I use gravity sync to keep both piholes in sync. Works very well and I can reboot one at a time without losing dns at all. Techno tim on YouTube has a guide on how to setup keepalived on 2 pihole servers that helped me set it up.

      • Baahb@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        1
        ·
        2 年前

        Yeah it is? There’s a reason your dns confutation has a backup IP address.

        • urquell@lemm.ee
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 年前

          That is true. But a simple service like dsn doesn’t go sideways every month usually. If he gets two of these services running, he just had double the trouble.

  • MigratingtoLemmy@lemmy.world
    link
    fedilink
    English
    arrow-up
    46
    arrow-down
    3
    ·
    edit-2
    2 年前

    If you can’t access your server and your router’s web interface, that’s a subnetting/DHCP allocation issue. Nothing to do with Pi-Hole.

    For reference, there’s 2 ways to allocate static addresses to devices:

    1. Define DHCP range, and configure the application to use a static address outside of the allocation pool.
    2. Give out static addresses by MAC.

    “Skill issue bro” /s

      • fuzzy_feeling@programming.dev
        link
        fedilink
        English
        arrow-up
        19
        arrow-down
        1
        ·
        2 年前

        I vote for 60 day lease time, iirc the clients try to get a new lease when half of the time is over, so they can keep the ip.

        • NaibofTabr@infosec.pub
          link
          fedilink
          English
          arrow-up
          9
          ·
          2 年前

          Maybe, but I suspect it’s working like this:

          • Pi boots then requests locally configured IP from DHCP server
          • DHCP server grants 30 day lease for requested IP
          • Pihole runs fine for awhile, DNS requests are properly handled
          • IP lease expires, DHCP server returns IP to available address pool but doesn’t reassign it to anything yet
          • time passes
          • Random wireless device connects to router, DHCP server assigns IP to new device
          • DNS requests to Pihole fail because the IP was assigned to the recently connected wireless device

          This would explain why Pihole appears to cause problems every month, sometimes a little longer.

    • PerogiBoi@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      17
      ·
      2 年前

      Definitely a skill issue haha. I’m brand new to this stuff so I’m trying to learn as fast as possible. Appreciate the help and the explanations!

      • R0cket_M00se@lemmy.world
        link
        fedilink
        English
        arrow-up
        10
        ·
        2 年前

        It’s alright, most computer geeks (even professional ones) can’t even figure out how IP addressing works. That’s why networking is its own sub group in enterprise environments.

  • Dhar@lemmy.ca
    link
    fedilink
    English
    arrow-up
    34
    ·
    2 年前

    First thought: Is your PiHole’s static IP within the range of addresses your DHCP server hands out?

    • PerogiBoi@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      14
      ·
      2 年前

      My Pihole lives on my server computer and so the DNS is the same IP address as that computer

      • whynotzoidberg@lemmy.world
        link
        fedilink
        English
        arrow-up
        31
        ·
        2 年前

        Irrelevant, unless your pihole is running on your DHCP server. Does the server running pihole have a statically assigned IP that is within the DHCP range being assigned to other devices?

        Static addresses should be outside of your DHCP range, ideally. If you can’t change the range, and assuming sequential handouts of IPs from your router among other things, you can try setting the server’s static IP to a bigger number.

            • PerogiBoi@lemmy.caOP
              link
              fedilink
              English
              arrow-up
              5
              ·
              2 年前

              Haha not quite. Sounds like an interesting post though. I’ll have to look that one up. From all the help given to me here though it looks like my “static” ip is within dhcp range so my router is giving everyone else my key to the castle and therefore invalidating my key.

              • RajaGila@feddit.nl
                link
                fedilink
                English
                arrow-up
                6
                ·
                2 年前

                Yea, duplicate IP addresses lead to some funny business. Toss a coin to see if a network packet will arrive basically.

                The solution is to adjust the DHCP range or use static DHCP on the router. The latter just means that the router will assign the same IP to the specified computer every time.

            • moody@lemmings.world
              link
              fedilink
              English
              arrow-up
              1
              ·
              2 年前

              I assume the issue was the bulb was getting assigned by DHCP the same address that was supposed to be reserved for their PC, thus their wifi appearing not to work for their PC.

          • whynotzoidberg@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            2 年前

            Oh my, I didn’t catch that one but will be searching for it!

            I love* solving wonky user issues. People do the darndest things.

            *Subject to tolerance and patience levels of both user and self

        • ArbiterXero@lemmy.world
          link
          fedilink
          English
          arrow-up
          18
          arrow-down
          2
          ·
          2 年前

          The static address should be assigned from the dhcp server.

          Assigning a static address on the nic is a recipe for issues.

          Set up a static assignment in your dhcp server.

          • PerogiBoi@lemmy.caOP
            link
            fedilink
            English
            arrow-up
            6
            arrow-down
            9
            ·
            2 年前

            I’m not able to log into my router in order to edit any of my dhcp settings 😭 little caveat there.

            • ArbiterXero@lemmy.world
              link
              fedilink
              English
              arrow-up
              20
              ·
              2 年前

              Then that’s likely your issue.

              Your router occasionally gives out the ip of your pihole to someone else, and everything shuts the bed.

              Try picking x.x.x.254 as the pihole address or x.x.x.2

              Often routers won’t use either the top end or low end of the available addresses.

              The machines on your network that are dhcp, do they go below 100? Do they go above 200?

              You’re going to be guessing a little here.

              What is your “net mask”

              • PerogiBoi@lemmy.caOP
                link
                fedilink
                English
                arrow-up
                8
                ·
                2 年前

                Ya I’m pretty sure you’re correct here and this is my issue. Since I’m not able to log into my router and define my dhcp range, I’ve picked an IP near the end of the range (254).

                All my other devices are assigned .23, .25, etc.

                Fun learning experience haha

                • ArbiterXero@lemmy.world
                  link
                  fedilink
                  English
                  arrow-up
                  7
                  ·
                  2 年前

                  Your ip-mask will tell you what IPs are accessible on the network

                  Likely goes nowhere because it’s probably 255.255.255.0 but it’s possible to be something else.

            • Osirus@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              6
              ·
              2 年前

              Are you on the same subnet as your router or are you on the subnet that your custom dhcp server is handing out? If your router is 192.168.1.1 and your ip is on the 192.168.2.x range, they aren’t going to be able to communicate.

        • PerogiBoi@lemmy.caOP
          link
          fedilink
          English
          arrow-up
          12
          arrow-down
          1
          ·
          2 年前

          Hm interesting. Basically my server is a windows computer (ya windows is not a good server OS I know, was lazy and experimenting) and in the windows network settings I assigned it a static IP that was within my DHCP range.

          I wasn’t aware you could set it outside the range but this makes sense that it should be outside of the range so that my router doesn’t give my servers IP address to something else.

          As you can tell I’m not super knowledgeable about networking but your help is making things make more sense. I appreciate it!

            • PerogiBoi@lemmy.caOP
              link
              fedilink
              English
              arrow-up
              3
              ·
              2 年前

              Haha yeah a big strong network person would be running proxmox or Ubuntu server or Debian or something and having a better time. I’m my defense, I’m both lazy and stupid so while (almost) everything is working, I’m keeping windows

              • NaibofTabr@infosec.pub
                link
                fedilink
                English
                arrow-up
                2
                ·
                2 年前

                It’s definitely more difficult when you don’t have control over the DHCP server. Is it part of a router provided by your ISP?

                • PerogiBoi@lemmy.caOP
                  link
                  fedilink
                  English
                  arrow-up
                  2
                  ·
                  2 年前

                  Yeah the router is provided by the ISP and it has very limited options on it but it is running the DHCP server.

              • whynotzoidberg@lemmy.world
                link
                fedilink
                English
                arrow-up
                2
                ·
                2 年前

                Nothing wrong with a Windows box as your server. Use what you know. Windows skills are a great asset in the world.

                This issue is OS-independent, meaning you would have the same problem on a Raspberry Pi as you did on your Windows box.

                GLHF

    • JustARegularNerd@aussie.zone
      link
      fedilink
      English
      arrow-up
      11
      ·
      2 年前

      Oh my gosh. I have been trying to figure this issue out with my docker containers for months. If this is the fix, THANK YOU.

      • ChrislyBear@lemmy.world
        link
        fedilink
        English
        arrow-up
        7
        ·
        edit-2
        2 年前

        I have had this issue for about a year, while trying different monitoring and logging solutions to try and find out what’s going on.

        This was such a bitch! Now I’m spreading the word, so that other won’t suffer as long as I have.

  • Chaotic Entropy@feddit.uk
    link
    fedilink
    English
    arrow-up
    25
    ·
    edit-2
    2 年前

    My first thought on this was immediately “did you also reserve that static IP address on your router to make sure it remains assigned”. From what I’ve read that does seem to be the issue, so that’s a little validating.

    • PerogiBoi@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 年前

      I managed to get into my router and my Pihole server shows up as static and I’ve assigned it an address at the higher end of the DHCP range so we’ll see when the lease expire 🤷

      • deadbeef79000@lemmy.nz
        link
        fedilink
        English
        arrow-up
        8
        ·
        2 年前

        Don’t set the static IP within the DHCP range (well you can, but it then depends on how smart your dhcp server is, just avoid the situation).

        You run a risk of the same IP being assigned to another device.

      • Chaotic Entropy@feddit.uk
        link
        fedilink
        English
        arrow-up
        5
        ·
        2 年前

        As long as the router has the IP explicitly reserved for the device your PiHole is running off of then it won’t be reassigned.

    • remer@lemmy.ml
      link
      fedilink
      arrow-up
      5
      ·
      2 年前

      This. I’ve always done dynamic IPs on my devices and set static IPs for them on my router. Never had an issue.

      • Bytemeister@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        2 年前

        This is the way. Although, to clarify, you should assign static IPs on your DHCP server, which for most SOHO networks, that’s going to be your router.

        If you assign statics on your hosts, your DHCP server will assign them the preferred address if available, but if it’s already assigned then the DHCP server is going to give your device the middle finger and assign them whatever the fuck it wants.

        • Encrypt-Keeper@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          2 年前

          Not sure if I’m misunderstanding you, but the router/DHCP server doesn’t assign an IP at all to a host that you’ve assigned statically. Any given host can be statically assigned or use DHCP, not both.

          The real problem with statically assigning IPs to hosts, is that your DHCP server won’t know that and could give a new device the same IP address as your statically assigned host, causing an IP conflict, if you statically assigned the host with an IP that’s inside the DHCP scope.

          What you have to do is only assign static IPs that are outside the DHCP scope, or set all hosts to use DHCP and then use reservations in your DHCP server to make sure they get the same one each time.

          • bless@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            2 年前

            For infrastructure critical services I recommend reservations on the DHCP server and then set static assignment on the device for the IP reserved in DHCP. This way if the device ever fails over to DHCP for any reason the IP will not change. I’ll usually also leave some small address space outside the DHCP scope available for static assignment if needed, usually at the front and usually around 20 IPs max as it’s easier to let DHCP do the heavy lifting.

            Static IPs are important on infra critical devices if you ever find yourself in a situation where the DHCP services are not available, you don’t want them to be a single point of failure.

            Just my 2 cents.

  • sharpiemarker@feddit.de
    link
    fedilink
    English
    arrow-up
    11
    ·
    2 年前

    Taking a look at your Pihole logs is going to be helpful. Also knowing what kind of device is running the Pihole software may also help.

    I had Pihole running on a raspberry pi 3 years ago, and I had pretty consistent issues. I’ve run it on other hardware since without a problem.

    It could be an issue with the SD card, if you’re using a raspberry pi. I’ve also read that the log file can grow large enough to cause issues with your Pihole instance.

    So there are a number of possibilities.

    • PerogiBoi@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 年前

      I’ll have to take a peak at the logs. I’ve been running the server nearly headless but with this issue I cannot access my server over my lan so I’m going to have to physically plug a screen and keyboard into it later.

      • sharpiemarker@feddit.de
        link
        fedilink
        English
        arrow-up
        3
        ·
        2 年前

        Yep, not having DNS/DHCP is a pain in the ass. When mine went down it would take my network with it because the Pihole was handling both. Expected but also a pain in the ass.

      • sharpiemarker@feddit.de
        link
        fedilink
        English
        arrow-up
        3
        arrow-down
        1
        ·
        2 年前

        One last piece of advice: Pihole has great support. I’ve gotten a ton of answers and assistance from the Pihole Sub on Reddit. I don’t know if it’s still active since the migration away from Reddit, but you may ask.

        • PerogiBoi@lemmy.caOP
          link
          fedilink
          English
          arrow-up
          4
          arrow-down
          1
          ·
          2 年前

          I’d rather ask here and start building up the knowledge base off Reddit but you’re right.

          I think I know my problem though (something I’m not able to fix aaaaa)

          • sharpiemarker@feddit.de
            link
            fedilink
            English
            arrow-up
            3
            ·
            2 年前

            I agree. Unfortunately I don’t think u/jfb-pihole is on Lemmy and they’re one of the devs (I think) for Pihole. Best of luck with your issue!

  • notannpc@lemmy.world
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    1
    ·
    2 年前

    I would HIGHLY recommend that for something as essential as DNS, you should be running it on its own hardware. Considering, as you’ve experienced, that any issues result in a complete loss of normal access to the internet.

    You can run pihole on something as small as a Raspberry Pi zero w, then just set it with a static IP and forget about it.

    Considering you said you’re currently using WSL I suspect there is an extra layer of networking bullshit that is breaking your routing. If you haven’t already looked at this document, it might have the information you need https://learn.microsoft.com/en-us/windows/wsl/networking#accessing-windows-networking-apps-from-linux-host-ip

    But for the sake of stable DNS services you will thank yourself for just getting a dedicated device of any power level to ONLY handle DNS.

  • seaQueue@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    2 年前

    I had similar issues when SLAAC wasn’t properly configured for my network. Every however many days my ISP forced a modem reboot and if the delegated prefix happened to change I’d start having pihole problems. I finally tracked that down, made sure SLAAC was working everywhere and assigned my pihole container a SLAAC token so its address relative to everything else on the network didn’t change and I’m good to go. These days the pihole is always …253 and ::253.

      • seaQueue@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        2 年前

        Yeah, SLAAC is stateless autoconfig for ipv6. It’s a little like DHCP in that the client gets an address automatically but it’s handled by the client machine rather than having a DHCP server running.

        SLAAC capable machines give themselves an address based on the ipv6 prefix advertised on the network then do a duplicate address check with all of the other devices to make sure they’re unique and away you go. There’s no central tracking of all dynamic addresses on the network segment, hence the stateless part of the name, but you can poll them with a neighbor request or broadcast ping when you want to see what’s there. The benefit is that basically everything you plug into your network probably supports SLAAC out of the box without needing to run server software anywhere to delegate addresses so new v6 clients just work without specific configuration.

        If the client supports it you can specify a SLAAC token that the machine will combine with the advertised network prefix rather than generating its own, which is how I have pihole showing up at ::253 as well as its DHCPv4 assigned …253. It’s a convenient configuration.

        I’d ignored SLAAC the first time around and given everything static v6 addresses without realizing that my provider would periodically change my prefix. That was fun to untangle, things worked if they made v4 requests but failed over v6 whenever my prefix changed so the failure mode appeared to be somewhat random depending on whether the service or application supported dual stack and was trying to connect over broken v6. Fun times.

  • eating3645@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    2 年前

    Give an alternative a go, see if you have better luck. There’s adguard home, blocky, and Technitium DNS for you to consider.

    Alternatively, the window trick should work.

    • Andi@feddit.uk
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 年前

      I had reliability issues with PiHole and moved to AdGuardHome a couple of years ago. It has never, ever crashed and the updates takes a couple of seconds. It rocks.

  • d0ntpan1c@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    1
    ·
    2 年前

    Not a solution to your current problem, but an alternative to consider depending on your network setup.

    I’ve been running unbound as my DNS via OPNSense. Same capabilities for blocklists, plus some nice privacy benefits with DoH/DoT. I think you can use unbound with pihole too, fwiw, i just don’t have a need for that.

    • ShortN0te@lemmy.ml
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      1
      ·
      2 年前

      Simple: Privacy. The DNS Server of you choosing sees every single domain you are visiting.

      Having a own DNS Server allows you to hide varies queries from big DNS providers.

      Additional you gain shorter latencies for cached request if you have set it up right.

      AND when you have local services you probably have a horizon splitting DNS anyway so setting up a pihole vs something like DNSmasq is not much hassle anyway.

        • ShortN0te@lemmy.ml
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 年前

          Which is why NextDNS allows you to decide if DNS requests get logged or not, for how long, on which country, and with encryption.

          You have to trust that statement and company since you can’t verify it.

          Hardly relevant nowadays.

          With the hundreds of DNS requests that a modern websites requires, it is more relevant then ever. For browsing DNS latency is for more important then dowload or upload speed.

    • PerogiBoi@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 年前

      Well in my case it’s due to me just not knowing that this other stuff exists and primarily wanting to Adblock with a piece of software that’s well known and well documented as I’m very noob at self hosting and networking 😛 I’ll have to take a look at those other services you’ve mentioned.

      Just fyi so you can hate me more, I’m running Pihole on Windows using WSL.

        • PerogiBoi@lemmy.caOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 年前

          All good I appreciate all the help and advice from the community here, even if some are politely telling me I’m an idiot lmao. Comes with technical communities so downvotes and the like don’t phase me (considering you can make a post, downvote yourself, then reliably start a downvote train even if there’s nothing wrong with the comment).

    • SheeEttin@lemmy.worldBanned
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      edit-2
      2 年前

      Can I add custom DNS forwarding rules to NextDNS? Because I need that for my internal network.

    • nbafantest@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      2 年前

      Its literally a single docker compose up command and one time log in to your router and changing the DNS.

      You act like its some crazy complicated thing lol