Skip to content

Instantly share code, notes, and snippets.

@int64ago
Created December 21, 2014 16:41
Show Gist options
  • Save int64ago/296abee12b6d64832728 to your computer and use it in GitHub Desktop.
Save int64ago/296abee12b6d64832728 to your computer and use it in GitHub Desktop.
dnsmasq update for China
#!/bin/sh
cnlist() {
wget -4 --no-check-certificate -O /etc/dnsmasq.d/accelerated-domains.china.conf https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf
wget -4 --no-check-certificate -O /etc/dnsmasq.d/bogus-nxdomain.china.conf https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf
}
adblock() {
wget -4 --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt |
grep ^\|\|[^\*]*\^$ |
sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' | uniq > /etc/dnsmasq.d/adblock.conf
wget -4 --no-check-certificate -O - https://raw.githubusercontent.com/kcschan/AdditionalAdblock/master/list.txt |
grep ^\|\|[^\*]*\^$ |
sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' >> /etc/dnsmasq.d/adblock.conf
}
hosts(){
wget -4 --no-check-certificate -O /etc/hosts https://raw.githubusercontent.com/zxdrive/imouto.host/master/imouto.host.txt
}
cnlist
adblock
hosts
#systemctl restart dnsmasq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment