Skip to content

Instantly share code, notes, and snippets.

@msquirogac
Created December 30, 2021 16:46
Show Gist options
  • Select an option

  • Save msquirogac/480dc6d74062ac2ca045a45efb857aea to your computer and use it in GitHub Desktop.

Select an option

Save msquirogac/480dc6d74062ac2ca045a45efb857aea to your computer and use it in GitHub Desktop.
#!/bin/sh
HOST1='https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts'
HOST2='https://raw.githubusercontent.com/notracking/hosts-blocklists/master/dnsmasq/dnsmasq.blacklist.txt'
HOST3='https://gist.githubusercontent.com/mlabbe/37e68b0dc33c0869d5333c83cfcc0a42/raw/53b1f1474308e2cb86ffeba0b61edf95d09749d9/windowsupdate.conf'
HOST4='https://raw.githubusercontent.com/matteofumagalli1275/xiaomi-dns-blocklist/master/xiaomi_dns_block.lst'
HOST5='https://raw.githubusercontent.com/matteofumagalli1275/xiaomi-dns-blocklist/master/xiaomi_dns_allow.txt'
wget -O- $HOST1 | awk '$1 == "0.0.0.0" { print "address=/"$2"/0.0.0.0/"}' > /etc/dnsmasq.d/blacklist1.conf
wget -O- $HOST2 > /etc/dnsmasq.d/blacklist2.conf
wget -O- $HOST3 > /etc/dnsmasq.d/blockwindows.conf
wget -O- $HOST4 | awk '{print "address=/"$1"/0.0.0.0/"}' > /etc/dnsmasq.d/blockxiaomi.conf
wget -O- $HOST5 | awk '{print "address=/"$1"/0.0.0.0/"}' >> /etc/dnsmasq.d/blockxiaomi.conf
systemctl restart dnsmasq.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment