PiHole Intermittent DNS Failures [Solved, Hardware issue]

What did you find out with step 4 - does eliminating the PiHole from the DNS loop speed things up?

The hardware you are using is sufficient for running PiHole. I have two PiHoles running in parallel (one primary, and one backup). Each has been primary at one point or another, and they are at the opposite ends of the performance spectrum. The primary is a 3B+ connected to router via ethernet, the backup is a ZeroWH on wireless. My home network has 26 clients with about 35-40K DNS requests per day. I haven't seen any performance issues with PiHole on either device. Each runs a Sandisk Ultra 32 GB SD UHS-1 card. Each of these Pi's is also running unbound as the local recursive resolver, which may add a bit to the CPU load.

I prefer the 3B+ because it's VNC graphic interface is much snappier. The ZeroWH I am using is the same chip as your B, but it's clocked about 40% faster. Not a huge difference. The 45 mbps from your Pi ethernet is plenty fast to just answer DNS requests.

If your delays are coming from the Pi/PiHole, to continue troubleshooting, I would try the following:

  1. Swap out your ethernet cable from Pi to router to eliminate a weak cable.
  2. What power supply are you using for the Pi? They can be wonky when you use either a low amperage device or a thin/cheap cable. If you have a 2+ amp supply with a decent cable, try that.
  3. If you have another SD card, clone your existing card to it and swap cards to eliminate any weird card issues.
  4. In the off chance you have another Pi, do an install on that and move your PiHole settings over with teleporter.

For about $30 US you could get a Pi ZeroW, 32 GB SD card, case and a Pi charger. If you are unable to get the performance up on what you have, it might be worth it to upgrade your Pi to all new. If you were to go this route, I would recommend a clean install from scratch.

1 Like

After about a day of directly using CloudFlare's DNS, I haven't experienced a single issue with DNS failing to resolve and everything has felt snappy and without issue.

I don't think the Raspberry Pi itself should be having any issue since it's a fresh install running nothing but PiHole. Barely any load at all.

It might be an ethernet/power supply/SD card issue or something, though. I'll try that tomorrow. If that doesn't work, I'll try formatting and doing another clean install.

It specifically seems like it's taking ~10 seconds to time out. Do you know if 10 seconds is a common timeout period for DNS or...? Hmm.

It seems like it's failing on CNAME + N/A, and then resolves correctly once it's cached.

I don't know if 10 secs is a common DNS timeout period, I haven't seen delays of this magnitude on my PiHoles. They are pretty snappy all around. Even with my local DNS resolver (unbound) having to go all over the internet to put together a new address not in cache, it's typically a few hundred msecs to get the address, and the PiHole gets it to the client immediately. Never multiple seconds.

Your data shows that the PiHole is resolving the DNS in a timely manner, yet it's not getting to the client quickly. See what effect the remaining troubleshooting steps have on the performance.

1 Like

Gah. I've swapped my Raspberry Pi's and desktops ethernet cables and replaced the Raspberry Pi's power supply and if anything, things have gotten worse. I'm getting the issue much more frequently.

It might be a power supply issue? The first power supply was unlabeled and the best labeled one I could find was 0.7 amps. :confused:

image

I can't even connect to the web interface, yet I can ping the Raspberry Pi. Something very odd is going on.

[Edit]



It appears the cause could potentially be due to some form of growing mass-filesystem corruption. The Raspberry Pi was not messed up like this yesterday, and I made 100% sure to shutdown the system cleanly before changing the power supply + Ethernet.

Could the filesystem be messed up due to the lack of a sufficient power supply? :thinking:

Welp. Apologies. I think I need to reformat this Raspberry Pi's SD card and try and buy a better power supply.

It could definitely be a power supply issue. I would not run an ethernet-enabled Pi on a 0.7 A charger.

I think you have a good plan there. While you are re-installing, you can make sure you're running the latest of everything.

1 Like

Ye, will do. Everything was latest anyways, since it was such a new install. Latest Raspbian version, all current updates and beta branch of PiHole, also up-to-date.

Do you have any recommendations for a good power supply? I'm guessing the first power supply was more than 0.7 amps, but still wasn't sufficient and caused subtler issues.

[Edit] A sad view of a dead PiHole. R.I.P.


Now to start the tedious process of changing all clients on my network to temporarily use CloudFlare DNS. :yum:

I have used a lot of different brands. For your model I would use a charger rated for at least 2 amps at 5V. Only use chargers that are clearly labeled with voltage and amperage - if they aren't labeled they're likely very small (0.7 amps or so).

I have a 3B+ running on an older Apple charger rated at 2.4 amps, connected with a good quality cable from Anker. A second 3B+ is running of a multiple-tap Anker charger that puts out 7 amps total across 4 ports, but it's the only load on that charger so it gets up to 2.5 amps. I have a Zero running on the 2A output port of my UPS.

Adafruit sells a really nice charger/cable for $7.50 (plus shipping, I typically buy one with each order from them). They up the voltage a bit and use a heavy cable, this will run any Pi at max load. 5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable : ID 1995 : $8.25 : Adafruit Industries, Unique & fun DIY electronics and kits

1 Like

Since your Pi is going to be down for a bit, enable DHCP on your router and have your router point to Cloudflare DNS, then when you restart your router all the clients should get a new lease and get pointed to the new DNS. You might have to toggle some of the clients off/on.

1 Like

Sadly my ISP's provided router doesn't allow router-level DNS changes from their own DNS. They serve advertisements on the NXDOMAIN search page, so that's not a feature in the router's settings.

Just done DHCP, but DNS will have to be manual.

(ISP - Virgin Media)

You may find that owning your own router (if that's an option) will be cheaper in the long run. If the ISP is charging a lease fee, you can recoup the cost of a nice router in less than a year. If you can do this, you regain control of your own network. I'm not a fan of combined modem/routers - I own my own modem and routers.

Pi-Supply has a good one as well, and in the UK. This would work nicely.

I don't know if this is the same issue I've experienced at my work location. I would be listening to SiriusXM all day, and from time to time, it would buffer or fail to play. After a while of tailing pihole logs to see what was going on, as far as I can see, it just didn't get the response back from upstream DNS provider, times out, tries again and succeeds. Never happened at my home and both locations have 150/15Mbps cable service.

But now I'm going to have to double check the PSU. It would have been rated for 2A, but could be defective. I would almost love to see a defective supply and be able to confirm it was to blame.

Incremental Update: My Raspberry stopped booting at all. Any power supply, any method of flashing the SD card or any image wouldn't work. NOOBs, Raspbian Headless, Etcher, dd, Copy/Paste NOOBs, nothing.

I then read the following Reddit thread and this comment in particular seemed odd, since my SD card port's left pin looked a fraction of a hair lower than the others. Barely noticeable and you wouldn't think anything of it, without a very close side-inspection with a flashlight.

I grabbed a pair of iFixit tweezers and gave a light tug/wiggle on each SD pin within the port, put the SD card in again and it boots. It appears this might be caused my a dodgy Raspi SD port. I'm going to try PiHole again and update this post if it works, to help anyone else who might have a similar issue with their PiHole/Raspi acting very strange for no reason.

1 Like

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