Block Reddit Ads with IPfire's Proxy

Is it possible to block ads on Reddit with the proxy, without having to set up e.g. PiHole?

Someone already tried to do so? I’m mainly reading Reddit on iPad or on Android smartphone, so no chance of using any browser add-on for blocking tasks available.

In my opinion it is possible, but the only way is to force proxy browsing by setting rules on the firewall, as explained here:

This (related to IPFire), I believe applies to any operation that requires blocking Web sites or services.

With the same system, I think you could block Reddit as well. :wink:

If you want to block only Reddit, once everything works, you can act on the url filter by creating custom rules. You can also enable browsing to all sites and block only those sites that are “hostile” to you. Remember, however, that the “impractical” thing is to set a proxy in all clients. And it cannot be done otherwise. This can often be annoying, but it is essential for everything to work.

Alternatively, if the site to be blocked is only Reddit, you can track the IP address and block only outgoing traffic from RED to that IP. Many times I have solved this way, but keep in mind that the IPs of sites can change or be in a high range. This is impossible to control with firewall rules alone.

1 Like

Only if you are accessing Reddit via http.

If using https then you can only filter out Reddit in total, not the sub urls for the adverts as those will be encrypted with https when going through the proxy.

3 Likes

It’s true. I confused the original post :man_facepalming:. My example refers to the “Reddit in total” block :blush:.

2 Likes

You can try using one of the following applications for these devices

Regards

Thanks for those links.

Unfortunately AdGuard on iOS works reliable only in Safari, when using DNS mode with other apps, too. I’m solely using MS Edge on my iPad.

Since I’m redirecting all DNS traffic to IPfire and do not allow other DNS requests besides IPfire’s own rDNS service, AdGuard does not work with iOS in my case.

1 Like

The brave browser is good at blocking ads if you want a client solution. It works on the main operating systems. Like Edge, it’s based on the same underlying software as Chrome.

For IPFire, there is PiHole-type functionality provided by the script here.

Full instructions for setting up are at the link. Here’s what I did:

  1. Created a script, update_dns_blocklist.sh to refresh the blocklist:
#!/bin/bash
/root/bin/dns_blocklist.sh -r refuse -w /var/ipfire/dhcp/whitelist -b /var/ipfire/dhcp/blacklist -s https://big.oisd.nl/

I put this in /etc/fcron.daily/ so that the blocked DNS addresses are updated every day. After experimenting with the blocklists mentioned by the script’s author, I settled on oisd, which has had no false positives in the three months I’ve used it. It’s updated frequently.

  1. Update IPFire firewall settings to redirect DNS to IPFire (so that the blocklist can be used). See IPFire docs on how to do this.

This will, of course, block a lot more adverts that just reddit. The script hasn’t been updated recently but the author confirmed it’s still maintained.

I’ve been very happy with it :smile:

2 Likes