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.

47 points
*

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

permalink
report
reply
41 points

A 30 day DHCP lease expiration would explain OP’s issue.

permalink
report
parent
reply
20 points

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.

permalink
report
parent
reply
10 points

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.

permalink
report
parent
reply
7 points

Basically, no static IPs at all. Lol

permalink
report
parent
reply
19 points

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!

permalink
report
parent
reply
10 points

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.

permalink
report
parent
reply
-10 points

If you’re a computer geek (even a professional one) and struggle with IP addressing, you won’t be having much of a career.

permalink
report
parent
reply
46 points
*
Deleted by creator
permalink
report
reply
11 points
*

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.

permalink
report
parent
reply
2 points

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

permalink
report
parent
reply
1 point

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

permalink
report
parent
reply
1 point
*

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)

permalink
report
parent
reply
9 points

You should probably also sync them. I use orbital sync for this. https://github.com/mattwebbio/orbital-sync

permalink
report
parent
reply
1 point

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

permalink
report
parent
reply
4 points

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.

permalink
report
parent
reply
0 points

This is not an answer to the question at all

permalink
report
parent
reply
1 point

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

permalink
report
parent
reply
1 point

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.

permalink
report
parent
reply
39 points

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

permalink
report
reply
-8 points

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

permalink
report
parent
reply
34 points

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.

permalink
report
parent
reply
22 points

Are we getting a repeat of the guy who’s wifi didn’t work because of a smart bulb?

permalink
report
parent
reply
17 points

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.

permalink
report
parent
reply
11 points

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!

permalink
report
parent
reply
30 points

Do you run your PiHole on top of Docker? There’s an issue with docker and Raspberry Pis which makes the network crap out periodically. So if your PuHole becomes unavailable until you restart your Pi it might be this:

https://github.com/raspberrypi/linux/issues/4092/

Solution is to add “denyinterfaces veth*” to the dhcpd.conf

permalink
report
reply
11 points

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.

permalink
report
parent
reply
7 points
*

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.

permalink
report
parent
reply
9 points

PuHole 🤣

permalink
report
parent
reply
5 points

Hahaha! I’m keeping this typo 😂

permalink
report
parent
reply
25 points
*

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.

permalink
report
reply
6 points

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 🤷

permalink
report
parent
reply
7 points

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.

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply

Selfhosted

!selfhosted@lemmy.world

Create post

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!

Community stats

  • 3.5K

    Monthly active users

  • 3.4K

    Posts

  • 77K

    Comments