From 91b2584845c95626e3595de67a5e45ba0667bf7e Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Sat, 11 Apr 2020 11:56:12 +0300 Subject: [PATCH] Handle special DNS zones only by their full blocked domain, not by third level domain --- generate-pac.sh | 2 +- scripts/getzones.awk | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/generate-pac.sh b/generate-pac.sh index 048c681..fe53471 100755 --- a/generate-pac.sh +++ b/generate-pac.sh @@ -66,7 +66,7 @@ echo " if (domains.length < 10) return \"DIRECT\"; // list is broken var shost; if (/\.(ru|co|cu|com|info|net|org|gov|edu|int|mil|biz|pp|ne|msk|spb|nnov|od|in|ho|cc|dn|i|tut|v|dp|sl|ddns|dyndns|livejournal|herokuapp|azurewebsites|cloudfront|ucoz|3dn|nov|linode|amazonaws|sl-reverse|kiev|beget|kirov|akadns|scaleway|fastly)\.[^.]+$/.test(host)) - shost = host.replace(/(.+)\.([^.]+\.[^.]+\.[^.]+$)/, \"\$2\"); + shost = host; else shost = host.replace(/(.+)\.([^.]+\.[^.]+$)/, \"\$2\"); diff --git a/scripts/getzones.awk b/scripts/getzones.awk index 39e13b2..05280d8 100644 --- a/scripts/getzones.awk +++ b/scripts/getzones.awk @@ -17,9 +17,7 @@ {sub(/\.$/, "", $1)} { - if (/\.(ru|co|cu|com|info|net|org|gov|edu|int|mil|biz|pp|ne|msk|spb|nnov|od|in|ho|cc|dn|i|tut|v|dp|sl|ddns|dyndns|livejournal|herokuapp|azurewebsites|cloudfront|ucoz|3dn|nov|linode|amazonaws|sl-reverse|kiev|beget|kirov|akadns|scaleway|fastly)\.[^.]+$/) - {$1 = gensub(/(.+)\.([^.]+\.[^.]+\.[^.]+$)/, "\\2", 1)} - else + if (!(/\.(ru|co|cu|com|info|net|org|gov|edu|int|mil|biz|pp|ne|msk|spb|nnov|od|in|ho|cc|dn|i|tut|v|dp|sl|ddns|dyndns|livejournal|herokuapp|azurewebsites|cloudfront|ucoz|3dn|nov|linode|amazonaws|sl-reverse|kiev|beget|kirov|akadns|scaleway|fastly|hldns|appspot|my1|hwcdn)\.[^.]+$/)) {$1 = gensub(/(.+)\.([^.]+\.[^.]+$)/, "\\2", 1)} } @@ -35,4 +33,4 @@ function printarray(arrname, arr) { # Final function END { printarray("d_other", d_other) -} \ No newline at end of file +}