Pihole randomly stopped working overnight

Expected Behaviour:

I'm running Pihole on a Raspberry Pi 4B. It serves as the DNS for two devices with which I'm testing pihole. The expected behavior is that pihole should work.

Actual Behaviour:

I'm still testing it but facing issues with stability. So far, twice, pihole has randomly stopped working rendering the 2 test client devices disconnected from the Internet (Screenshot of the query timeline graphe in the link below). The Pihole stopped working randomly after I'd gone to bed. As I'd already retired for the night and only I have access to the Pihole setup, there were no changes made from when it was working to when it randomly stopped working

In the morning, both the test clients weren't able to connect to the Internet. I was also unable to access the pihole admin interface. I was able to connect to the RPi via ssh and vnc. Searching around on the internet, I restarted the dns service (pihole restartdns) but that did not work.

Soon after that, I stepped away from the laptop while connected via VNC. After about 30 minutes, when I returned, VNC stopped working - VNC showed as still connected but it would not respond. SSH was working fine and still connected. VNC would not reconnect. I was again unable to connect to the pihole admin after this. Finally, I thought of restarting pihole but instead ran pihole -r and chose the repair option. That finally fixed it and I was again able to access the pihole admin as well as connect via vbnc

Why did the pihole randomly stop working and how do I prevent it? I'll have several devices connecting via the pihole and in my absence, co-residents are not tech savvy to be able to restart the pihole if it stops working.

Screenshot of query history:

Separately, whenever I run pihole -d, I get the following error every time

[?] Would you like to upload the log? [y/N] y
* Using curl for transmission.
* curl failed, falling back to netcat for transmission.

Debug Token:

https://tricorder.pi-hole.net/bf77tqv7mm

Your observation does not support any failure of Pi-hole.
Rather, it would suggest a network connectivity issue.

Your debug log shows indeed a wlan0 interface failure:

*** [ DIAGNOSING ]: Networking
[✗] No IPv4 address(es) found on the wlan0 interface.
[✗] No IPv6 address(es) found on the wlan0 interface

And while wlan0 is failing, your RPi is fully capable of using its eth0 LAN connection:

*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
   Scanning all your interfaces for DHCP servers
   
   * Received 300 bytes from eth0:192.168.0.1
     Offered IP address: 192.168.0.6
     DHCP options:
      Message type: DHCPOFFER (2)
      lease-time: Infinite
      dns-server: 208.67.222.222
      dns-server: 208.67.220.220
      router: 192.168.0.1
      --- end of options ---
    
   DHCP packets received on interface wlan0: 0
   DHCP packets received on interface eth0: 1

I suspect your wlan0 connection to have been dropped by our RPi's OS when it went into power saving mode during periods of low activity (not that uncommon an issue with RPis). You'd have invited further trouble if you'd configured your router to assign an identical IP address for both of your RPi's network interfaces (wlan0 and eth0).
Clients connecting to Pi-hole through its wlan0 IP address would stall, while those being routed via its eth0 IP address would continue to work.
You probably could address this by disabling or configuring power management for wlan0.

But since eth0 is available, it would be preferable to configure Pi-hole for it.
You may do so by running

pihole -r

and choosing Reconfigure.
You could also consider disabling wlan0 altogether if you do not need it otherwise.

In addition, the debug log excerpt above also shows that your router is handing out two public DNS server IPs via DHCP.
This would have your DHCP clients by-pass Pi-hole completely.

If your router supports switching DNS servers, you should check its lease time also. Your RPi 4B would have been assigned an infinite lease (though that may be due to setting a DHCP lease reservation /fixed IP address for your RPi). An infinite lease would mean your DHCP clients never pick up any changes to your router's DHCP information, unless they disconnect from your nework and rejoin it anew.

If your router doesn't support changing that configuration, you could consider to disable your router's DHCP server and enable Pi-hole's, or you could manually point each device's DNS settings to Pi-hole.

I have turned-off WiFi (wlan0) via the OS (icon on the top right of raspbian?) so that might be the reason why it doesn't have an IP address assigned?
I have enabled listen to all interfaces (the first option in Pihole settings) and the RPi is connected to my router directly via a Cat 5e cable. The DNS server is set to the IP of the RPi ethernet port

This is probably because I've not yet set Pihole as the DNS server at the router level but only on two test devices while I monitor the behavior and performance of Pihole.
Also, to add, I've assigned/reserved the RPi's IP address on the router's DHCP server. I also restarted the router after the DHCP assignment

As recommended above, start by Reconfiguring your Pi-hole for eth0 and see if that solves your issue.

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