Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
router:adblock [2024/10/24 18:50] – willy | router:adblock [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Simple approach: Ads Blocking ====== | ||
- | |||
- | You have already installed the DNS service to manage your home network DNS (and DHCP), so you can easily use it to filter ads as well. | ||
- | |||
- | First of all you need a good, comprehensive and up-to-date **block list**. I suggest you using the official [[https:// | ||
- | |||
- | ==== Ad Blocking with Unbound ==== | ||
- | |||
- | Download the block list for the first time by hand: | ||
- | <code bash> | ||
- | wget ' | ||
- | </ | ||
- | |||
- | Just add a cron task to daily update your blocklist. Add the following line: | ||
- | < | ||
- | 0 0 * * * wget ' | ||
- | </ | ||
- | |||
- | to root's crontab: | ||
- | <code bash> | ||
- | crontab -e | ||
- | </ | ||
- | |||
- | To add this block list to Unbound, you need a row in the unbound configuration file like: | ||
- | < | ||
- | include: / | ||
- | </ | ||
- | | ||
- | as i have already shown you in the [[router: | ||
- | |||
- | ==== Ad Blocking with DNSMasq ==== | ||
- | |||
- | DNSMasq support two different ways to add blocklist. One is via custon **hosts** files, the other is via custom **configuration** files. OISD blocklists are in // | ||
- | |||
- | To use **hosts** format, just download your file and put it somewhere (i will assume **/ | ||
- | < | ||
- | addn-hosts=/ | ||
- | </ | ||
- | and reload dnsmasq. | ||
- | |||
- | To use **configuration** format, create a folder called **/ | ||
- | < | ||
- | conf-dir=/ | ||
- | </ | ||
- | this will load any file with **.conf** extension in that folder. | ||
- | |||
- | Now you need to download the OISD blocklist in that folder. | ||
- | <code bash> | ||
- | mkdir / | ||
- | wget ' | ||
- | / | ||
- | </ | ||
- | |||
- | This will work in addition to the AdGuard DNS you have already setup, but this will prevent any query going out to AdGuard for those domain. This is even more efficient. | ||
- | |||
- | For automatic updates, just add a cron task to daily update your blocklist. Add the following line: | ||
- | < | ||
- | 0 0 * * * wget ' | ||
- | </ | ||
- | |||
- | to root's crontab: | ||
- | <code bash> | ||
- | crontab -e | ||
- | </ | ||
- | |||
- | and you are all set. | ||