I have a Raspberry Pi 02W running Pi-Hole and ordinarily things work perfectly, but I’ve got something in my house tripping my fuse box which I’m unable to locate. The tripper, not the fuse box. Anyway, what it means is occasionally, I lose power and so my router and my Pi-Hole go down.

I’ve configured my /etc/dhcpcd.conf so that my RPi02W can have a static IP

interface wlan0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=194.168.4.100 194.168.8.100

And have rebooted to confirm it’s fine, and it’s fine.

However when the router goes down and I bring everything back up, the Pi-Hole can’t reconnect to the router. I can log in to the router and see it connect briefly, but it’s only briefly and then nothing. I even try enabling DHCP on the router and it still refuses to reconnect. Ultimately the only way to get it to reconnect is to factory reset the router, change the password back to my usual password, wait for the RPi02W to connect and then disable the DHCP again. Needless to say it’s a pain in the arse.

What am I doing wrong? How do I fix this?

#Solution I switched the DNS servers from Virgin Media to 8.8.8.8 and that seems to fix it. Not sure why, but it does.

  • lemmyreader@lemmy.ml
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    25 days ago

    On routers and modems the DHCP range is usually not allocating the full range for IP addresses to hand out to devices. If I were you I would configure the pi-hole to have a static IP address on the pi-hole itself so it will be independent from your router’s DHCP server. For example let’s say

    • the DHCP IP range is 192.168.1.20 to 192.168.1.254
    • then you can pick for example 192.168.1.19 for your pi-hole

    With that approach you will avoid IP address conflicts and the pi-hole should be fine. If you’re using systemd on the pi-hole that is maybe easiest, here an example :

    Another option is to use nmtui from NetworkManager