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.
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:
- Define DHCP range, and configure the application to use a static address outside of the allocation pool.
- Give out static addresses by MAC.
“Skill issue bro” /s
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.
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.
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!
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.
If you’re a computer geek (even a professional one) and struggle with IP addressing, you won’t be having much of a career.
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.
I have a google router and It allows me to enter 2 DNS servers incase the first DNS Server doesnt work.
You should probably also sync them. I use orbital sync for this. https://github.com/mattwebbio/orbital-sync
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.
Yeah it is? There’s a reason your dns confutation has a backup IP address.
First thought: Is your PiHole’s static IP within the range of addresses your DHCP server hands out?
My Pihole lives on my server computer and so the DNS is the same IP address as that computer
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.
Are we getting a repeat of the guy who’s wifi didn’t work because of a smart bulb?
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.
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!
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
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.
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.
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 🤷