I'm having some trouble getting pi-hole working on RPi Zero W

Hi all. First I’m new here, so I hope this is in the correct section. Feel free to move it if not. Thanks for having me.

My aim is to set up a Raspberry Pi Zero W as a pi-hole for home network-wide ad blocking. I use an Archer A7 router in my network. I have followed several video tutorials on setting up the pi-hole and I have read some step-by-step tutorials as well, since I have been having trouble. I have tried once with a full Debian desktop install and then the Lite version using Raspberry Pi Imager. I have my pi set up with a static IP from my router (double-checked my dhcpcd.conf file). I have my router DNS set to the pi IP. I also have my local PC client DNS set to the pi IP, just in case (but I believe that is redundant). The install went smoothly without any hangups, except… every single install of pi-hole shows me only 1 third party list for ad blocking, and that is StevenBlack (that’s on the screen after selecting the upstream DNS provider). Maybe this is my issue, but not sure how to resolve it. I have done the install 3 times, using Google, OpenDNS, and cloudflare and all were the same.

How am I testing or confirming that the pi-hole is not/working? First, I am confirming that my device(s) are using the DNS IP I have set in the router. Then I am going to speedtest.net in a browser, and viewing a Youtube video with ads (just trying a bunch of videos), and viewing Youtube on my TV. In all cases, I am still seeing the regular amount of ads.

Any help or suggestions would be appreciated. Or, if you need more details from my setup or need me to test something, feel free to reach out. Thanks!

1 Like

Welcome!

Pi Hole is great! Sounds like you have most everything setup correctly; I’m not sure that it blocks YouTube ads due to how they’re served. I still get Hulu ads, because of the way they have them setup to run. Here’s a slightly outdated thread on the topic, but let’s check to make sure it’s working in general first.

If you want to test if it’s working, you can always login, go to Blacklist and add something like www.youtube.com and see if it loads. If it does, PiHole isn’t working in general.

Also, right off the login the dashboard should show you what’s being blocked.

image

1 Like

I think you are right, and I don’t expect to have 100% ad blocking. I was expecting some improvement though, like on speedtest .net for example.

Blockquote If you want to test if it’s working, you can always login, go to [Blacklist] and add something like [www.youtube.com] and see if it loads. If it does, PiHole isn’t working in general.

Not sure if I quoted you properly :slight_smile:
That is a great suggestion, and also one that I have tried, adding facebook .com and www.facebook .com. They are both in my blacklist right now and bringing up facebook works fine (no blocking). So by that test, it seems it is not working.
Does that help us troubleshoot a little? What else can I check or try?

Here is my Blocked Domains, and then all the numbers at the top of my dashboard.

You can always add more lists:

In looking for that, I saw this interesting link as well: Dashboard Indicates ads are being blocked, but I am still seeing every ad possible - #3 by Bucking_Horn - Help - Pi-hole Userspace

And I just tried the same thing to block facebook and it kept loading. So I un-enabled it in Firefox, then it blocked it [unrelated, now I’m torn about that, but interesting to see it working]: Firefox DNS-over-HTTPS | Firefox Help

If you block YouTube in PiHole, was it still pulling up on your TV (maybe the TV is using DNS-over-HTTPS as well).

EDITL Forgot to mention you can always add more, like: https://firebog.net/

1 Like

This is all very helpful. Thanks…

I am reading through that first thread that you listed. I think there are some tips I can take from it outside of this problem right now, but haven’t found my solution yet.

I am using Chrome. I can look through that Firefox link that you sent me. Maybe I should install Firefox and run some testing?

When youtube is blocked, pulling it up on my TV is still no problem. It works fine, so not being blocked.

Regarding firebog, I haven’t added that URL to my blocklist, but I have selected several of the lists separately from that page and added them individually. Should I add that URL and block every list contained on the page? I can try that too. The reason that I haven’t done that is because a tutorial I watched said there could be many false positives if that is done.

edit And then my other problem… I turn off Adblock in my Chrome browser and load a Youtube video. It shows the 5 seconds (number) until my video will be shown, and waits there… forever. The video never gets shown, so something is working. There is blocking happening, but it doesn’t help me watch a video.
…follow-up… if I hit the ‘next video’ button and then the ‘Skid Ad’ button, the Youtube video starts playing. Maybe that’s normal and expected?

I don’t watch a lot of YouTube, so I can’t help too much on that. I would look specifically for YouTube ad blocking on some of the PiHole forums.

Try visiting one of those sites on your dashboard, see if it blocks that. Or try to ping on of those URLs, and see if you get bytes back from localhost. That would at least prove if PiHole is working.

You can also try this site to test if it’s working! Pi-Hole Ad Tester – Fuzz The Pi Guy

Excellent. Thanks for those ideas. I’ll give those a try.

EDIT
When I ping sites that are listed in the Blocked Domains list on my dashboard, I get replies. Shouldn’t that fail? If I am logged in to my pi-hole and I ping one of the blocked domains, I get a reply from localhost. What does that tell us? (Honest question, since I thought it should fail)
The blocked domains are also available to me when visiting the URL in Chrome.

When I visit that test site, I do not see any ads, so it seems that pi-hole is working. I am going to remove my DNS settings to bypass the pi-hole and see if the ads will show up…
I removed my DNS settings (local and router) and I still do not see ads on that page. I did not flush any cache or restart my router, so maybe that needs to be done.

Sounds like your computers (whatever is pinging and getting through) isn’t set to look at the PiHole. Can you send a screenshot of your router using the PiHole as DNS? Is the Pi IP address reserved on the router (if it’s setup that way)? Meaning when you SSH to it, are you doing ssh user@pi.hole or user@192.168.1.142 ? Your Pi could be up (as proven by failed pings when logged in) but the IP might not be assigned correctly, therefore the router is trying it then moving on to the backup DNS.

image

I don’t know much about that other site, I just found it as another link. Do you have other ad-blockers on your browser that might be interfering with it?

Oops, you are totally right. I was using a browser ad blocker, so that’s why I never saw ads on that test site. Turning off the ad blocker, I now see all the ads.

See my screenshot of my router’s settings below. I think it is set up properly. I can ssh to the pihole using the IP or the name (such as: ssh pi@pihole). Let me know if you think this looks correct?

Good to know on ad-blocker.

It looks right, but it’s not working. So just to make sure, the IP on the pihole is 192.168.0.11 right? You can do ssh pi@192.168.0.11 and it’ll connect it.

Actually, Can you change either the IP Address pool to include .11 or move the Pihole IP address into that IP Address Pool range? I don’t know enough about networking, but I wonder if it’s outside of that range if it’s failing. Even though the IP address is still valid?

Yes, the pi-hole is 192.168.0.11. I am able to ssh into it using the IP or the system name.

I changed the IP pool range to include .11 and rebooted the pi-hole (it is still using the same IP). Still not blocking the ads on the test site. Any other ideas, like do I need to clear cache to see results?

I will be changing the IP pool range back to exclude .11 to avoid DHCP conflicts, but I am happy to change it back if you have more ideas.

EDIT
I’m going to add some more sites to the blocklist, to see if I can get any results.

I don’t know at this point, sorry! Sounds like it’s all setup right. Maybe someone else can chime in, or try over on the PiHole forum.

Let us know what you come up with if you go over there though, I’m curious as to the issue.

This is me out on a limb, but you could maybe try to flush the DNS cache on your machine just to see if that is causing it. My PiHoles have always worked immediately, but I don’t think it would hurt to try: How to flush the DNS cache on Linux | TechRepublic

I do really appreciate you chiming in to give me some ideas and look at my configuration. I will do the DNS flush and head on over to the PiHole forum. That is probably the best place for this type of question. I will definitely come back to update this when I resolve it.

Many thanks!

EDIT Just to follow up, clearing the cache on the raspberry pi dns is done easily with the command “pihole restartdns” (no quotes). However, there are other places that dns caching might need to be cleared, such as browser, operating system, and apps used to access the domain. This information was acquired from How do I flush my Pi-hole cache? - FAQs - Pi-hole Userspace

I ran the ‘restartdns’ command given above and no progress has been made yet.

EDIT 2 I just received a Raspberry Pi 4 8GB. I didn’t plan on doing this (for my RPi 4), but I can also try installing pi-hole onto that Raspberry and see what are my results. Unfortunately, I really wanted to have the RPi Zero running as my pi-hole.

Some interesting information has just arisen. I got a new Raspberry pi. I installed the OS and, after some Wifi trouble, got it connected to the network with the pihole set as the DNS. I have not set up or enabled any ad blocking on it yet, and I have visited speedtest .net and cnn .com and the fuzzthepiguy adtest site. Result: No ads on the new RPi! Wow. Ok, so there is something about the system I have been working on so far (it seems). It is a Windows 10 machine. Maybe I need to do a better job of clearing cache or something else, but this is progress. I will continue with updates as I find them :slight_smile:

EDIT Testing on another system in my network, Ubuntu 20.04, ads do not seem to be blocked. This leads me to believe it is a system caching issue. Any other input or advice is surely appreciated.

1 Like

Did you clear DNS cache on Ubuntu?

Do either of these machines have ad-blocking in the browsers?

Good questions.
I just ran the test again on Ubuntu after clearing DNS cache and ensuring no ad blockers were enabled. I do see ads there.
On the Raspberry Pi (with Raspberry Pi desktop installed), no ad blocker is active (Chromium browser). I do not see ads on speedtest.net or the fuzzthpiguy ad testing site.
I’m jumping through hoops trying to get other tech working lately, so ad blocking has competition for my attention.

They’re all on the same network, right?

I’d still say try a PiHole forum, I’m not sure why it’s working on Windows + Pi itself but not your Ubuntu install.

Maybe there was a slight mix-up and I may have written things wrong. It is not working on Windows and Ubuntu. It does seem to be working on my Raspberry Pi with chromium. Yeah, I think a Pi-hole forum would be best to figure this out. Thanks.

If it’s working on the PiHole but not anything on your network, it has to be something network related. I don’t know how the PiHole on a desktop-enabled Pi routes traffic, but I would see if it has rules enabled on there. Or turn off the PiHole functionality from the admin center for a second and try those same sites from the PiHole to see if there are ads.