Can't connect to internet after the pi-hole setup restarts

So I have a habit of turning off my wifi router and modem at night and I recently set up pi-hole on my raspberry Pi. At first I wanted to set it up as a recursive DNS (by using unbound) but it didn't work out and I couldn't figure out how to make it work so I uninstalled unbound and made it send requests to couldfare's 1.1.1.1 DNS server. I have the pi a static ip address assigned(192.168.0.102) and I have set that same IP address on my router as the only DNS server. But whenever I restart my setup (router, modem and the pi) the router and the pi are connected to the internet but the other devices that are connected wirelessly on the network can't connect to the internet. To fix this I have to go back and add another dns server in addition with the pi's ip address (I add 1.1.1.1) and when I do that the internet works on other devices but pi-hole doesn't consider them as clients so no ad blocking. I tried turning on the pi first, and then turning on the router but it isn't working even then. Sometimes I remove the 2nd dns adress and then pi hole blocks ads but it's just until the next restart.

Expected Behaviour:

Whenever the network setup restarts, the router should connect to the internet and all the devices connected wirelessly on the network should also be connected to the internet and every device should have pi-hole blocking working

Actual Behaviour:

Whenever the setup restarts, the pi and the router are connected to the internet but the other devices connected don't seem to have the internet working. Changing the dns to 1.1.1.1(in addition with the pi-hole ip address) makes the internet available to all devices but pi-hole ad blocking is not functioning.

Debug Token:

k0swh6vC

Where?
To have Pihole's functions your router must tell the clients connecting to it the IP of a DNS-server to use. Usually this is done by the router's DHCP-server and it is announcing its own IP (the LAN IP of the router). So the clients are sending the DNS requests to the router and the router forward them (usually) to the DNS servers of the provider.
Changing the DNS IPs of the routers internet connection may not help.
The best way to get the clients behind the router using a local DNS is to set up its IP address(es) within the DHCP setup of the router. Most routers are able to announce an other DNS server IP in their local network for the clients if given at DHCP configuration.

Changing the DNS of the routers internet connection may not help:
First its because not all routers can route DNS requests back into the local network. Second, if they can, they are "all the clients", which means: the nice client-targeted filtering of Pihole can not be used.
Lastly you should make sure that in such a case the router may not (!) set as DNS server at the device where Pihole is running at and not in Pihole itself. Otherwise DNS requests are circling to death between your router and Pihole.

This appears to be the root cause of your problem. Don't do this.

As you noted, when you have your DHCP server provide multiple DNS options, clients are free to use any of them and some (or all) of the DNS traffic bypasses Pi-hole.

Your debug log shows that the active interface on the Pi is not responding to DNS traffic. That is at least one of the problems.

*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✓] fish.muted.io is 0.0.0.0 via localhost (127.0.0.1)
[✗] Failed to resolve fish.muted.io via Pi-hole (192.168.0.102)
[✓] doubleclick.com is 172.217.166.46 via a remote, public DNS server (8.8.8.8)

*** [ DIAGNOSING ]: Networking
[✓] IPv4 address(es) bound to the eth0 interface:
   192.168.0.102/24 matches the IP found in /etc/pihole/setupVars.conf

*** [ DIAGNOSING ]: Setup variables
    PIHOLE_INTERFACE=eth0
    IPV4_ADDRESS=192.168.0.102/24

Have you tried to restart the Pi-Hole server?
pihole restartdns

Maybe it will work then. If not, the issue is most likely on the router's side.

1 Like

I have entered the ip address of the pi-hole in the router's DHCP settings. Where it says to enter the dns server IP I have entered 192.168.0.102(static ip that I set for my pi). I am pretty new to this so I can't fully understand what you are trying to tell me to do. Can you explain in a simpler language please?

I can't not restart it. Even if I keep it online all the time, my area has frequent power outages so I will have to fix it everytime the power goes out. There's a fix here probably but I'm too much of a newbie to find/fix it. I'll still keep my search going on

Thank you. This worked.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.