Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| sailing:adblock [2024/01/09 12:18] – willy | sailing:adblock [2024/02/22 09:48] (current) – removed willy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Blocking Ads ====== | ||
| - | |||
| - | Nobody like ads, let's be real. Also, ads are a security risk since they can deliver malware or force the users to tap on stuff they shouldn' | ||
| - | |||
| - | I am using [[https:// | ||
| - | |||
| - | Install it: | ||
| - | <code bash> | ||
| - | > emerge dnsmasq | ||
| - | </ | ||
| - | |||
| - | and edit your config file **/ | ||
| - | < | ||
| - | # Interfacce to operate on | ||
| - | interface=enpXXX | ||
| - | |||
| - | # Do not resolve upstream internal names | ||
| - | domain-needed | ||
| - | # Never forward addresses in the non-routed address spaces | ||
| - | bogus-priv | ||
| - | |||
| - | # Local domain: | ||
| - | local=/ | ||
| - | domain=home | ||
| - | |||
| - | # DNS from AdGuard | ||
| - | no-resolv | ||
| - | no-poll | ||
| - | server=94.140.14.14 | ||
| - | server=94.140.15.15 | ||
| - | |||
| - | # More ads filters: | ||
| - | addn-hosts=/ | ||
| - | |||
| - | # DHCP Settings | ||
| - | dhcp-range=10.0.0.100, | ||
| - | dhcp-option=option: | ||
| - | dhcp-option=option: | ||
| - | </ | ||
| - | |||
| - | The more complex way is to populate that file, which is a standard //hosts// file, so in the format: | ||
| - | < | ||
| - | 0.0.0.0 ads.google.com | ||
| - | </ | ||
| - | where the trick is mapping all ads servers to invalid addresses like 0.0.0.0. | ||
| - | |||
| - | There are some good adblock lists here: | ||
| - | |||
| - | |||
| - | And this command will download and properly format it: | ||
| - | <code bash> | ||
| - | curl " | ||
| - | </ | ||
| - | |||
| - | All you need to do now is add to //crontab// for automatic updates, add a line like: | ||
| - | < | ||
| - | 0 4 * * * root curl " | ||
| - | </ | ||
| - | |||
| - | to your | ||
| - | <code bash> | ||
| - | > crontab -e | ||
| - | </ | ||
| - | |||
| - | (content of this page has been inspired a lot by [[https:// | ||
| - | |||