Installing pihole kills the internet on my Raspberry Pi

Please follow the below template, it will help us to help you!

If you are Experiencing issues with a Pi-hole install that has non-standard elements (e.g you are using nginx instead of lighttpd, or there is some other aspect of your install that is customised) - please use the Community Help category.

Expected Behaviour:

Pihole should start working and my internet connectivity should not be affected.

Actual Behaviour:

My Raspberry Pi Zero 2 stops being able to connect to the internet. I can't

Debug Token:

I uninstalled Pihole to resolve this issue but the internet didn't come back. And now I can't reinstall Pihole to create a Debug log.

Other notes:

  • I've been using Pihole for over 2 years, in fact I'm a donator. Everything has been working beautifully except I switched to Bell and as soon as I install Pihole on any of my Raspberry Pis (I have several), the internet dies on those Pis. I don't get it because I've never had any issues with Pihole before.

I just want to get the internet back on this machine without having to reinstall the OS.

Doesn't ring a bell with me... :wink:
What does that mean exactly?

What OS do you run your RPis on?

Oh sorry, Bell internet.

I use the Raspberry Pi OS 64bit official.

After switching, I reinstalled Pihole on my main RPI (which acts as my fileserver and also Pihole server). I didn't have anything fancy setup, just some NFS and the Pihole of course. After switching to Bell, Pihole wouldn't work and I had to reinstall. Every time I installed Pihole (I did 6 or 7 times) on my fileserver RPI, the internet would shutoff. I had to factory reset my router to get things back to normal. So, I gave up trying to get Pihole running on my fileserver. Lo and behold as soon as I installed Pihole on my RPI-Zero2 (which is the machine this thread is about), the internet went down.

I simply don't get it. Been using and loving Pihole for 2 years, and now with this new internet, which is very fast (1.5Gbps), Pihole kills the internet on any machine I install it onto? SSHing into the 'dead' machine works, it's just that I can't ping 1.1.1.1 or anything else for that matter.

:confused:

Did changing your ISP require you to change your router also?

Buster/10 or Bullseye/11?
(Running cat /etc/os-release may help answering that.)

If the latter, did you stick with dhcpcd for network configuration?

Bullseye. Yes I set my ip via /etc/dhcpcd.conf

What about:

Did Bell provide a new router?

Run from your Pi-hole host, what's the output of:

ip -4 a
grep -v '^#\|^$' /etc/dhcpcd.conf

Ok so I think something goes wrong when I adjust settings in /etc/dhcpcd.conf.

I flashed lastest RPIOS on a new sd, ran through updates, raspi-config, and no other changes were made. I added the following to /etc/dhcpcd.conf and though I was able to SSH in via the new local IP address, the internet stopped working (can't curl or ping outside world).

interface eth0
static ip_address=192.168.2.102/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1

interface wlan0
static ip_address=192.168.2.103/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1

This output was collected after above changes.

pi@vpn:~/.ssh $ ip -4 a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 192.168.2.103/24 brd 192.168.2.255 scope global noprefixroute wlan0
       valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 192.168.2.102/24 brd 192.168.2.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
pi@vpn:~/.ssh $ grep -v '^#\|^$' /etc/dhcpcd.conf
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private
interface eth0
static ip_address=192.168.2.102/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1
interface wlan0
static ip_address=192.168.2.103/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1

I have reset my /etc/dhcpcd.conf, and now I'm able to connect to the internet again.

As a test, I would like to install pihole on this fresh setup (the dhcpcd.conf has been reset), but obviously need to set a static ip, and since my previous attempt didn't work, I ask you to recommend another way of doing this manually (I know pihole does this for you but I prefer to make these adjustments myself).

Please, also provide the corresponding results for that working state, i.e. for those ip and grep commands.

pi@vpn:~ $ ip -4 a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 192.168.2.23/24 brd 192.168.2.255 scope global dynamic noprefixroute eth0
       valid_lft 257032sec preferred_lft 224834sec
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 192.168.2.24/24 brd 192.168.2.255 scope global dynamic noprefixroute wlan0
       valid_lft 257025sec preferred_lft 224827sec
pi@vpn:~ $ grep -v '^#\|^$' /etc/dhcpcd.conf
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private

I know that the internet is working because I can ping and also start the pihole install process via curl (which I aborted).

During Pi-hole's installation, just opt for keeping the IP as is.
Make sure you set a fixed IP for the machine hosting Pi-hole in your router.

There should be no reason to reinstall Pi-hole, but let's put that aside for the moment. We may return to this later.

You've determined that Internet access is failing independently from Pi-hole:

This would suggest that either your static router or your static DNS server settings would introduce your issue.

What's the output of

ip route

And how is your router configured to make use of Pi-hole?

And let me ask again:

Sorry missed this. Yes, I'm using my ISP's router+modem combo. This was necessary.

pi@vpn:~ $ ip route
default via 192.168.2.1 dev eth0 proto dhcp src 192.168.2.23 metric 202 
default via 192.168.2.1 dev wlan0 proto dhcp src 192.168.2.24 metric 303 
192.168.2.0/24 dev eth0 proto dhcp scope link src 192.168.2.23 metric 202 
192.168.2.0/24 dev wlan0 proto dhcp scope link src 192.168.2.24 metric 303 

And how is your router configured to make use of Pi-hole?

Have not made any changes to the new router to work with Pihole because I had given up on it. Originally though, I had set the DNS servers in the router to point to my RPi-pihole server.

Side note: on my RPI-fileserver (which is not the target of this thread), I have set my static ip via the same method and there are no internet issues.

interface eth0
static ip_address=192.168.2.100/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1

interface wlan0
static ip_address=192.168.2.101/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1

Buster in this case, however.

$ ip -4 a                                                                    
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    inet 192.168.2.100/24 brd 192.168.2.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 192.168.2.101/24 brd 192.168.2.255 scope global noprefixroute wlan0
       valid_lft forever preferred_lft forever
5: pia: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    inet [redacted]/32 scope global pia
       valid_lft forever preferred_lft forever

$ grep -v '^#\|^$' /etc/dhcpcd.conf                                                    
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private
interface eth0
static ip_address=192.168.2.100/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1
interface wlan0
static ip_address=192.168.2.101/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1
$ ip route
default via 192.168.2.1 dev eth0 src 192.168.2.100 metric 202 
default via 192.168.2.1 dev wlan0 src 192.168.2.101 metric 303 
192.168.2.0/24 dev eth0 proto dhcp scope link src 192.168.2.100 metric 202 
192.168.2.0/24 dev wlan0 proto dhcp scope link src 192.168.2.101 metric 303 

Your router/gateway and netmask seem to correctly match your network.

Run on your Zero 2, what's the output of:

cat /etc/resolv.conf

And:

And how is your router configured to make use of Pi-hole?

Have not made any changes to the new router to work with Pihole because I had given up on it. Originally though, I had set the DNS servers in the router to point to my RPi-pihole server.

pi@vpn:~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain home
nameserver 192.168.2.1
nameserver 207.164.234.193

Just letting you know that Pihole is not currently installed. Ready to do so at any time.

Did you configure your router to use Pi-hole as its upstream DNS, or to distribute Pi-hole as local DNS resolver?

I'm starting to suspect that you've configured a DNS loop somehow.

@Bucking_Horn hmmm on my previous router, all I did was set the DNS servers to point to my Pihole machine, so DNS1 was set to 192.168.1.100 (which is my file server which was hosting Pihole as well).

I'm ready to install Pihole on target machine (fresh install on RPIZ2) as soon as you say.

That doesn't answer my question yet. :wink:

There is a significant difference in having your router operate Pi-hole as a local DNS resolver (commonly, a LAN/DHCP type of setting) and using it merely as upstream (a WAN/Internet type of setting).

Sorry I can't be more specific in what to look for. If that's not enough to figure what your router actually supports, your router's documentation should have the details.

Pointing you router to use your RPi Zero 2 for DNS while pointing your RPi Zero 2 to use your router for DNS could force DNS packets into a perpetual loop.

hmm I followed Pihole official docks. So, during Pihole install, I told it to use 1.1.1.1 as the DNS (I think I'm remembering this correctly). Then I did what's in the picture, as in, I told my router to use my Pihole machine as DNS1 and kept DNS2 empty.

I made no other changes. Does that help clarify the situation? I also know that Pihole was working because the stats would update in the dashboard, and also when some sites/links refused to open in my browser, I would disable Pihole for 10seconds or 5 minutes, and then those same links would work.

Your resolv.conf suggests your router would distribute 192.168.2.1 and 207.164.234.193 as local DNS resolvers.

I realise that screenshot is from our page, but would it be showing your router's UI?
If not, please check your actual router UI.