PiHole and Adblock

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
stuartbh
Posts: 76
Joined: Sun Oct 20, 2019 4:18 pm

PiHole and Adblock

Post by stuartbh »

Gargoyle users/developers,

I am interested in maximizing my ability to block ads on my network and recently installed PiHole into a container running on my ProxMox V7 server.

Initially I set my DNS to be the IP address of the PiHole server in the DNS menu in Gargoyle (removing all other DNS IP addresses) and this did not work to give clients access to resolve domains. I also had Adblock disabled during this test too.

I then enabled Adblock again, changed the DNS menu to have the "OpenDNS" setting and then set in the /etc/dnsmasq.conf file dhcp-option 6 to the Pi-Hole server and things work but I am not sure if they are setup as I had intended things to function. I also have Allow NameCoin/OpenNIC Resolution and Force Clients To Use Router DNS Servers ticked off (enabled) too.

My intended operational design was this:

Client DHCPs an IP address and receives Pi-Hole as it DNS server, Pi-Hole does its work and then use the DNS servers set in the Gargoyle DNS menu to forward on its DNS resolution thus causing adblock to be used as well.

My intention was for clients to fallback to using the Gargoyle DNS entries to resolve DNS if the Pi-Hole server went down but to use PiHole first to try to block ads in concert with Adblock.

One last question is, is there some manner by which I can automate Adblock to get updates for its blocklist?

Ideas and suggestions?

Thanks in advance!
Very Respectfully,

Stuart, N3GWG
Computer Scientist

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: PiHole and Adblock

Post by Lantis »

If you're using an external local DNS server (e.g. a pihole) you can't use "enforce router DNS" as per https://github.com/ericpaulbishop/gargoyle/issues/794

I don't know about the whole cascaded DNS thing, but in theory what you've done with Option 6 is correct. But again you can't have force router DNS in play. You also need to manually configure Pihole to use Gargoyle as its primary DNS.
I believe using option 6 you can specify additional servers? That is how you achieve failover. There's also a setting to look at servers in order which might be per client.

Adblock auto updates on Sundays at 3:45am
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

stuartbh
Posts: 76
Joined: Sun Oct 20, 2019 4:18 pm

Re: PiHole and Adblock

Post by stuartbh »

Currently I have Gargoyle set to use "OpenDNS Servers" and I also have the "Allow NameCoin/OpenNIC Resolution" ticked too. I now have unticked "Force Clients To Use Router DNS Servers".

Having a place in the menu to set DHCP option 6 would be nice. Do you think this would be a big deal to add into the feature request list for the next version?

I am always nervous to modify the dnsmasq.conf file as I am afraid something else in Gargoyle will wipe out my changes at some point. I had been trying to get Gargoyle to act as a PXE server, but decided against that recently for two reasons.

1. I find it useful for my PXE server to be a virtual machine I have on my Mac that I can take anywhere with me, even if I am on some other network.

2. Although I like the idea that Gargoyle uses dnsmasq (ISC DHCP seems nicer in some ways with its comparative "if" capabilities ostensibly exceeding those of dnsmasq), it seems not a big deal to run a dnsmasq proxy on a VM. I had some trouble and plan to contact their forum or the author direcetly about how to get a few of my dhcp-match, dhcp-boot, and pxe-service statements in dnsmasq to work in the way I desire, but that is another issue. If ISC DHCP offered a proxy mode (I understand it does not), I'd just install that on my pxe server VM rather than dnsmasq.

With respect to option 6, you are saying to provide two IP addresses then, the IP address of the Pi-Hole server followed by the IP address of the Gargoyle router as well as telling Pi-Hole to use the Gargoyle router IP as its authoritative DNS? Seems like a DNS loop about to happen no?

I honestly have not paid much attention to such, but does AdBlock auto update every Sunday in Gargoyle? If not, can we add such a tick box to allow for that to occur (another feature request, yeah, yeah)?

Thanks as always!
Very Respectfully,

Stuart, N3GWG
Computer Scientist

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: PiHole and Adblock

Post by Lantis »

stuartbh wrote:
Thu Sep 09, 2021 11:44 am
Having a place in the menu to set DHCP option 6 would be nice. Do you think this would be a big deal to add into the feature request list for the next version?
Probably not an unreasonable ask. It is quite a common use case.
stuartbh wrote:
Thu Sep 09, 2021 11:44 am
With respect to option 6, you are saying to provide two IP addresses then, the IP address of the Pi-Hole server followed by the IP address of the Gargoyle router as well as telling Pi-Hole to use the Gargoyle router IP as its authoritative DNS? Seems like a DNS loop about to happen no?
You wanted redundancy/failover, right?
Happy path: Device requests PiHole, which requests Gargoyle, which requests the Internet.
Rainy day path: Device requests PiHole, no answer. Device requests Gargoyle, which requests the internet.
stuartbh wrote:
Thu Sep 09, 2021 11:44 am
I honestly have not paid much attention to such, but does AdBlock auto update every Sunday in Gargoyle? If not, can we add such a tick box to allow for that to occur (another feature request, yeah, yeah)?
It already works that way as per my last reply.
https://github.com/ericpaulbishop/gargo ... ock.sh#L18
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply