Selfhosted
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:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
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.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
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
A 30 day DHCP lease expiration would explain OP's issue.
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.
Basically, no static IPs at all. Lol
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.
First thought: Is your PiHole's static IP within the range of addresses your DHCP server hands out?
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.
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.
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 🤷
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.
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.
Are you assigning the static address on your pi, or are you assigning a static address on the router?
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.
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.
Your static IP probably isn't set on the router
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.
For those that don't know SLAAC is the "new DHCP" IPv6, I had to remember what it was.
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Fewer Letters | More Letters |
---|---|
CGNAT | Carrier-Grade NAT |
DNS | Domain Name Service/System |
HA | Home Assistant automation software |
~ | High Availability |
IP | Internet Protocol |
NAS | Network-Attached Storage |
NAT | Network Address Translation |
PiHole | Network-wide ad-blocker (DNS sinkhole) |
RPi | Raspberry Pi brand of SBC |
SBC | Single-Board Computer |
SSD | Solid State Drive mass storage |
SSH | Secure Shell for remote terminal access |
10 acronyms in this thread; the most compressed thread commented on today has 12 acronyms.
[Thread #209 for this sub, first seen 11th Oct 2023, 11:55] [FAQ] [Full list] [Contact] [Source code]