Need help understanding how to set up DNS settings for pi-hole ad-blocking at home.

Hi there and thanks for looking.

Preamble: I have experience dealing with networking things but am not an expert.

Desire for blocking ads stemmed from my kids being bombarded with ads while watching YouTube on our smart TV. Some of the ads were not age appropriate so I wanted to do something about it. Pi-hole was recommended as a whole home solution so all of your devices benefit from lack of ads and aggressive tracking scripts.

I have set up a Raspberry Pi unit at home which is running pi-hole ad-blocking software. The upstream DNS is set to Google, and everything else is set up per pi-hole setup instructions.

My router is an ASUS AC66U-B1 and has been configured to use the raspberry Pi's static IP as its DNS server in the LAN tab in the admin panel. I noticed that if LAN is configured to use the Pi's static IP then ads are blocked as expected on all devices that are wired in. My mobile devices on the other hand do not benefit from ad-blocking.

It was then recommended that the WAN portion of the routers admin would benefit from the same DNS settings. If I set up the WAN DNS to the Pi's IP then my internet connection from router to the outside world is disrupted and it cannot resolve its own IP I.e. No outside internet connection. I've seen discussions on the web where people set both WAN and LAN DNS to that of the Pi, but in my case WAN drops all outside connection.

Pretty basic up to this point. This is now where it might get interesting.

I suspected that my Hitron CGN3 modem might be the reason why WAN and custom DNS don't play well together. I have the Hitron running in bridged mode (i.e. not Gateway which provides wifi and other services like a normal router). Attempting to log into the admin portal at 192.168.0.1 or 192.168.100.1 doesn't work. I found a discussion on a Rogers forum where I have to do a factory reset in order to be able to log back into the admin panel. So I did the factory reset and yep, the panel is there as expected. I tinkered with the settings to see if I could make the DNS manual while dropping it back into bridged mode, but no success. It's just back into bridge mode, and not able to access the admin panel.

So, my assumption is that the modem is basically either all engaged, or just in most basic bridge mode.

My question is whether some of you folks have made an attempt to get pi-hole to run on your own home network and were successful in making it work network-wide via DNS rather than per-device? Am I stuck because of the modem, or is there something fundamental that I may be misunderstanding and thus configuring improperly?

Thanks so much for reading this and have a great day!

Vlado

Posted Oct 27, 2020, 12:20 AM UTC · edited

315
GalacticaZero•

If you put your Hitron in bridge mode, then it's just a modem and forwards the dhcp information to your router. Hence, you can't change anything.

Check your wireless IP's DHCP information and make sure DNS is still pointing to your pihole and make sure mobile data is disabled while testing. Your Asus router would be the one handing out DHCP information to your wireless devices and not the Hitron. Also, double check your wireless setup does not have it's own DHCP settings.

5
digitalthinkerOP•

Thanks for walking me through that, it helped to click it together. I will check the settings as you suggested and see what it looks like in more detail.

1
digitalthinkerOP•

I had a look at my various devices where I could see the DNS reading. So the pihole DNS does appear as one of the DNS options (192.168.50.99). In addition to the pihole, the gateway IP also shows up as a DNS entry (192.168.50.1).

My desktop has some additional DNS entries whose origin or destination I am unsure about: 2607:f2c0::1, 2607:f2c0::2

Does this look like the DNS setup is ok, or should it only be the pihole entry that appears?

1
GalacticaZero•

Those are IPv6 addresses. If you don't use IPv6, just disable it in your network adaptor properties.

For pihole, network settings is fine. Your issue is with your wireless devices and whether your router's DHCP configuration is pushing out the pihole's IP address as the DNS settings on each of the wireless devices.

Also, as others have stated, some phones will bypass wireless and use mobile data if the wireless' internet connection is not working.

I would review this site and see if you've missed anything:

https://blog.cryptoaustralia.org.au/instructions-for-setting-up-pi-hole/

1
c0mputerRFD•

Have you had success accessing the Hitron UI in a bridge mode 192.168.100.1 when you are not connected to a coaxial cable ?

2
digitalthinkerOP•

Interesting suggestion, and I have not. Is there different expected behaviour when it is not linked to the ISP?

1
unwantedoffspring•

One thing to note that Pi-hole doesn't do well with blocking YouTube ads. Pi-Hole is a DNS-level adblocker, meaning that it will block content coming from specific DNS addresses. However, Google is ever the smart one and serves their ads from the very same DNS addresses that it serves its video content from. So if you wanted to block YouTube ads, you'd end up blocking all their videos, too. (Spotify does the same thing). The only way to block YouTube ads with Pi-Hole is to constantly update your blocklist addresses with the new addresses that Google keeps pumping out. It's a cat and mouse game with them.

Not that setting up Pi-Hole isn't a great idea to begin with, I just wanted to chime in and warn you that not all YouTube ads (if any at all) will be blocked with a Pi-Hole.

Some discussion (and /thread from the devs) on that here: https://discourse.pi-hole.net/t/how-do-i-block-ads-on-youtube/253

2
digitalthinkerOP•

Thanks for the heads up on this, it helps explain some of my earlier failed attempts to clean up YouTube.

I've had to sideload custom YouTube apps (YouTube Vanced) on my android device to get around youtube ads. Brave browser as well as Bromite have been helpful as well. It looks like keeping the browser-level adblock is still the way to go in order to catch some of the missed bits.

1
unwantedoffspring•

Yup, you basically need to continue using browser-based adblocking for YouTube, which doesn't work for smart TVs or streaming devices like Fire sticks, Rokus, etc.

That's the only way around it, since browser extension adblockers actually check the actual content to determine if it needs to be blocked or not. DNS level blockers just block everything from a specific domain.

Or I guess you could use Vanced and cast to your TV? Kind of defeats your purpose of installing the Pi-Hole, but I feel it works best for blocking ads in YT outside of a browser extension.

1
ericshead•

I had a different setup than you did (modem-router combo; forget the model from TekSavvy... but that's not really my point here), and I could get everything wired to work, but our phones - Google Pixel devices - never could; in fact, half the time I couldn't even get an IP address for them. Long story, short: Pixel devices seem to use the Google DNS, magically dodging your PiHole it seems, regardless of whatever your local setup is. So, all I can contribute is, if you're having trouble with your Google wireless devices, look specifically into using them in a PiHole setup. In the end, at least for now, I've pulled it back out of the network (which is unfortunate because I otherwise was quite happy with it).

1
digitalthinkerOP•

Thanks for sharing that, I would not have suspected that google is hard wired into their devices. To be honest it doesn't surprise me finding that out.

Sounds like while testing things out that I will be keeping an eye out for this kind of beahiour, especially on my wife's pixel device.

1
unwantedoffspring•

If you have configured your modem-router setup properly, then the Pi-Hole will work for your Pixel device, too. Pixel devices aren't hardcoded to use Google DNS, it uses the DNS that your network router serves. Even my Google Home devices are being blocked by my Pi-Hole, because they must go through the router before they can go out to the public internet.

1
heysoundude•

Ok, a couple of things: Good choice bridging the modem unit into a pure gateway. Are you running stock Asus firmware, or the asuswrt-Merlin alternative? (I think the current v384.19 is able to work on your model, but I may be mistaken, so check the website). The reason I ask is that Merlin firmware has developers working on scripts that make what your pihole does happen on the router itself, and they’re largely configured to simply work. And work together. One of those scripts, unbound, turns your router into a caching rDNS server for your network to reference, bypassing Google’s tracking of your web activities that way. It also allows you to use Ad and Tracker blocking. Others include firewalls to prevent hacking/spying and block certain sites entirely if you wish (to protect your kids)...and I can go on, but I like that it’s all on the router, working at the LAN level for every device connected rather than on individual machines (like your smart tv) that need individual updating/maintenance if possible (again, your smart tv)

1
digitalthinkerOP•

Thanks for bringing up the on-router option, it was actually my primary reason for buying this router as it appeared to have that capability. Going into it, it appeared to be a bit more work than I had time allotted towards the project so think of it as phase 2 of my home network project. :)

The router firmware is still stock and I figured that running pihole for a bit and having something to compare to would be helpful, before I roll up my sleeves and invest the time in figuring out the firmware and the detailed setup that comes with it.

Have you had the experience with unbound yourself? How has it worked out and was it thorough? Keeping sneaky spyware out like Google's services would certainly be refreshing.

1
heysoundude•

Unbound w/blocking under Merlin is working quite well - dns calls to the cache are equal to the non-cached calls to AUTH servers, but the speed is ridiculous -1 usec vs 30ish msec. Bad stuff gets blocked before I get it on my client devices, and Brave browser backs the blocking up with its own version to stop whatever might sneak through. Two thumbs and two big toes way up from this primate.

1