Configuring Unbound as adblocker

(redirected from Openbsd.Unboundadblock)

Unbound as an adblocker

Unbound, by using blacklists, can play the role of an adblocker. Such curated list can be found on https://oisd.nl/setup/unbound. In order to use it, you have to:

  1. download one of the lists, for example https://small.oisd.nl/unbound
  2. give it a suitable name like unbound-bl.conf
  3. place it in /var/unbound/etc
  4. add this line in unbound.conf:
include: "/var/unbound/etc/unbound"

If this produces no error, you can restart the service with rcctl. To check that the blacklist prevents the name resolver from getting an IP, the "dig" command of a blacklisted domain should return 0.0.0.0.

For example:

$ dig trc.taboola.com
...
;; ANSWER SECTION:
trc.taboola.com.        3600    IN      A       0.0.0.0
...

See Also:

https://www.geoghegan.ca/unbound-adblock.html