From 6c81b86c92cbd7a13dda8bde17c47d0f9965ae29 Mon Sep 17 00:00:00 2001 From: Colin Mahns Date: Sat, 20 Aug 2016 14:40:33 -0400 Subject: [PATCH 1/2] Link to MVPS Hosts file directly http://www.mvps.org/winhelp2002/hosts.txt redirects to http://winhelp2002.mvps.org/hosts.txt automatically, saves a step --- roles/dns_adblocking/templates/adblock.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/dns_adblocking/templates/adblock.sh b/roles/dns_adblocking/templates/adblock.sh index e2bd95f..daae47e 100644 --- a/roles/dns_adblocking/templates/adblock.sh +++ b/roles/dns_adblocking/templates/adblock.sh @@ -13,7 +13,7 @@ rm -f /var/lib/dnsmasq/block.hosts echo 'Downloading hosts lists...' #Download and process the files needed to make the lists (enable/add more, if you want) -wget -qO- http://www.mvps.org/winhelp2002/hosts.txt| awk -v r="$ENDPOINT_IP4" '{sub(/^0.0.0.0/, r)} $0 ~ "^"r' > "$TEMP" +wget -qO- http://winhelp2002.mvps.org/hosts.txt| awk -v r="$ENDPOINT_IP4" '{sub(/^0.0.0.0/, r)} $0 ~ "^"r' > "$TEMP" wget -qO- "http://adaway.org/hosts.txt"|awk -v r="$ENDPOINT_IP4" '{sub(/^127.0.0.1/, r)} $0 ~ "^"r' >> "$TEMP" wget -qO- http://www.malwaredomainlist.com/hostslist/hosts.txt|awk -v r="$ENDPOINT_IP4" '{sub(/^127.0.0.1/, r)} $0 ~ "^"r' >> "$TEMP" wget -qO- "http://hosts-file.net/.\ad_servers.txt"|awk -v r="$ENDPOINT_IP4" '{sub(/^127.0.0.1/, r)} $0 ~ "^"r' >> "$TEMP" From 1fbe1b63f8be2fb6c2c5faeb2a88f977eb1bdc33 Mon Sep 17 00:00:00 2001 From: Colin Mahns Date: Sat, 20 Aug 2016 14:48:31 -0400 Subject: [PATCH 2/2] HTTPS for domains that support it hosts-file.net and malwaredomainlist.com has optional TLS, adaway.org forces it server side --- roles/dns_adblocking/templates/adblock.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/dns_adblocking/templates/adblock.sh b/roles/dns_adblocking/templates/adblock.sh index daae47e..46a55d1 100644 --- a/roles/dns_adblocking/templates/adblock.sh +++ b/roles/dns_adblocking/templates/adblock.sh @@ -14,9 +14,9 @@ rm -f /var/lib/dnsmasq/block.hosts echo 'Downloading hosts lists...' #Download and process the files needed to make the lists (enable/add more, if you want) wget -qO- http://winhelp2002.mvps.org/hosts.txt| awk -v r="$ENDPOINT_IP4" '{sub(/^0.0.0.0/, r)} $0 ~ "^"r' > "$TEMP" -wget -qO- "http://adaway.org/hosts.txt"|awk -v r="$ENDPOINT_IP4" '{sub(/^127.0.0.1/, r)} $0 ~ "^"r' >> "$TEMP" -wget -qO- http://www.malwaredomainlist.com/hostslist/hosts.txt|awk -v r="$ENDPOINT_IP4" '{sub(/^127.0.0.1/, r)} $0 ~ "^"r' >> "$TEMP" -wget -qO- "http://hosts-file.net/.\ad_servers.txt"|awk -v r="$ENDPOINT_IP4" '{sub(/^127.0.0.1/, r)} $0 ~ "^"r' >> "$TEMP" +wget -qO- "https://adaway.org/hosts.txt"|awk -v r="$ENDPOINT_IP4" '{sub(/^127.0.0.1/, r)} $0 ~ "^"r' >> "$TEMP" +wget -qO- https://www.malwaredomainlist.com/hostslist/hosts.txt|awk -v r="$ENDPOINT_IP4" '{sub(/^127.0.0.1/, r)} $0 ~ "^"r' >> "$TEMP" +wget -qO- "https://hosts-file.net/.\ad_servers.txt"|awk -v r="$ENDPOINT_IP4" '{sub(/^127.0.0.1/, r)} $0 ~ "^"r' >> "$TEMP" #Add black list, if non-empty if [ -s "/var/lib/dnsmasq/black.list" ]