Hardware: Raspberry Pi v4 - 4GB RAM
Software: Pi-Hole V5 (upgraded from V4)
Problem: At random the Pi-Hole will just stop resolving DNS requests. The Pi-Hole is the default DNS server for the small LAN. When this issue happens I can ping the device and ssh in to it. However I cannot ping the internet from the device or from any device using it. If I restart DNS resolver it starts to work again. I've tried switching between different upstream DNS servers and the problem still persists.
I keep the OS and Pi-Hole software up to date and perform the usual maintenance
ping problems would normally indicate some basic networking problems, as the protocol used is distinctively different from DNS. dig or nslookup would be better suited to help you diagnose DNS issues (aside from the fact that of course, ping itself queries the DNS service for resolving hostnames into target IP addresses).
So I am going to assume that your problem is DNS related, as you state a simple restart of Pi-hole's DNS resolver solves the issue
When this reoccurs, you may want to check your system logs for indications of why pihole-FTL is not working as expected.
You could also check the output from the following command on your Pi-hole machine:
sudo systemctl status --full --no-pager pihole-FTL.service
We've had recent reports on pihole-FTL crashing unexpectedly, but so far weren't able to reproduce the error.
If you were affected from this, you should encounter crash reports in Pi-hole's log files.
You could check for this by running the following command on your Pi-hole machine:
sudo systemctl status --full --no-pager pihole-FTL.service
● pihole-FTL.service - LSB: pihole-FTL daemon
Loaded: loaded (/etc/init.d/pihole-FTL; generated)
Active: active (exited) since Fri 2020-06-12 10:06:46 BST; 6min ago
Docs: man:systemd-sysv-generator(8)
Process: 17136 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)
Jun 12 10:06:45 pihole systemd[1]: Starting LSB: pihole-FTL daemon...
Jun 12 10:06:45 pihole pihole-FTL[17136]: Not running
Jun 12 10:06:45 pihole su[17160]: (to pihole) root on none
Jun 12 10:06:45 pihole su[17160]: pam_unix(su:session): session opened for user pihole by (uid=0)
Jun 12 10:06:46 pihole pihole-FTL[17136]: FTL started!
Jun 12 10:06:46 pihole su[17160]: pam_unix(su:session): session closed for user pihole
Jun 12 10:06:46 pihole systemd[1]: Started LSB: pihole-FTL daemon.
grep -n "FTL crashed" /var/log/pihole-FTL.log*
returns nothing
I've tested and replaced the LAN cables.
Tested another Raspberry Pi (same model etc)
Checked the managed switch settings (even reset back to factory settings)