Open Collective
Open Collective
Loading
Now in beta: Ad blocking
Published on April 9, 2020 by billz

RaspAP is introducing a new feature to block DNS requests for ads, trackers and other undesirable hosts. There have been several discussions around integrating RaspAP with Pi-hole, with the end goal of hosting a complete AP and ad-blocker on a single device. Both projects rely on dnsmasq, however, so integrating them is tricky. As it turns out, implementing an ad blocking feature is fairly straightforward. So we're pleased to roll this out as a public beta to our users.

To participate in the beta and enable ad blocking, simply use the installer to (re)install RaspAP using the --adblock option, like so:

curl -sL https://install.raspap.com | bash -s -- --adblock

Answer 'Y' by pressing [Enter] to the Configure ad blocking prompt. The installer will download the blocklists and configure RaspAP to use them.

Updating lists

The notracking project used for this maintains two blocklists; hostnames and domains. These are updated daily, so it's a good practice to refresh them periodically. You can do this from the Ad Blocking management page in RaspAP. Simply select the list from the dropdown and choose 'Update now'.

More details on this new feature are available here.

More tips and tricks

If you have an existing Adguard Home install on your device, integration with RaspAP is trivial. Change Adguard Home’s listening port to 5300 and bind to 127.0.0.1, then go to RaspAP's DHCP Server > Advanced page and enable the Upstream DNS Server option. Add 127.0.0.1#5300 as an upstream DNS Server. Save settings and restart dnsmasq. Via the wiki.