Skip to content

Instantly share code, notes, and snippets.

@alexalouit
Created November 7, 2017 10:28
Show Gist options
  • Save alexalouit/3a0997e2968907f60d37b60d3bc31441 to your computer and use it in GitHub Desktop.
Save alexalouit/3a0997e2968907f60d37b60d3bc31441 to your computer and use it in GitHub Desktop.
Dnsmasq based ads blacklist (use @StevenBlack/hosts)
#!/bin/bash
# cron ex: @daily /root/scripts/adblock.sh >> /dev/null
# be sure dnsmasq load /etc/dnsmasq.d/*.conf
wget -O- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | awk '$1 == "0.0.0.0" { print "address=/"$2"/0.0.0.0/"}' > /etc/dnsmasq.d/ad_hosts.conf
#/etc/init.d/dnsmasq restart
systemctl restart dnsmasq.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment