From 8bddbebab4cf1b4cb50d5c002e05f1838703a25c Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Wed, 14 Dec 2022 16:31:53 -0800 Subject: [PATCH 01/20] major changes for compatibility and usability 1. Removed `bc` requirement and use `awk` instead, for systems that do not have `bc` for integer maths 1. Revamp how arrays are built and sanitized 1. Automatically detect and test against self-hosted DNS (checks for port 53 use and adds 127.0.0.1 to the nameserver list) 1. Auto-number resolv.conf nameservers to distinguish listings 1. Revamp internal DNS Provider and Domains 2 Test lists, compensating for bad entries and adding the ability to add comments lines 1. Modify logging to be as compact as reasonably possible. Providers column is now dynamically sized 1. Display corresponding Domains 2 Test list at end so we know which tests were to what --- dnstest.sh | 338 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 265 insertions(+), 73 deletions(-) diff --git a/dnstest.sh b/dnstest.sh index a617d26..65a2bc2 100755 --- a/dnstest.sh +++ b/dnstest.sh @@ -1,104 +1,296 @@ #!/usr/bin/env bash +# shellcheck disable=SC2034,SC2207 +# shellcheck source=/dev/null +# bash /volume1/homes/admin/scripts/bash/dnstest.sh +# CHECK FOR DIG REQUIREMENT +if ! command -v dig &> /dev/null; then + echo + echo "* DIG (Domain Information Gopher) is required for DNS queries, but" + echo " is not found in the PATH. Please install it." + echo + if [ -e "/proc/sys/kernel/syno_hw_version" ]; then + echo " DIG can be installed as a part of the 'SynoCli Network Tools'" + echo " package. This can be installed via the DSM Package Center by" + echo " adding the 'SynoCommunity' Package Source site, located at:" + echo + echo " https://packages.synocommunity.com/" + else + echo " DIG can typically be installed as a part of the 'dnsutils'" + echo " or 'bind-utils' packages. These can be installed via your" + echo " package management system." + fi + echo + echo Exiting... + echo +exit 1 +fi -command -v bc > /dev/null || { echo "error: bc was not found. Please install bc."; exit 1; } -{ command -v drill > /dev/null && dig=drill; } || { command -v dig > /dev/null && dig=dig; } || { echo "error: dig was not found. Please install dnsutils."; exit 1; } - +# BUILD LIST OF NAMESERVERS USED BY THIS HOST +NAMESERVERS=($(grep ^nameserver /etc/resolv.conf | awk 'BEGIN{i=0}{i++;}{print $2 "#" $1 "/" i}')) -NAMESERVERS=`cat /etc/resolv.conf | grep ^nameserver | cut -d " " -f 2 | sed 's/\(.*\)/&#&/'` +# CHECK IF LOCALHOST IS RUNNING DNS ON THE DEFAULT PORT +if LOCALTEST=$(netstat -tulpnW | grep "\:53\b" | grep "tcp\b" | grep "LISTEN"); then +# if [ "$?" -eq "0" ]; then + LOCALDNS=$(echo "$LOCALTEST" | awk -F '/' 'NR==1{ print $2 }') + LOCALHOST=127.0.0.1#"$LOCALDNS" + NAMESERVERS=("${LOCALHOST}" "${NAMESERVERS[@]}") +fi +# SANITIZE NAMESERVERS ARRAY +shopt -s extglob # turn on extended glob +NAMESERVERS=( "${NAMESERVERS[@]/#+([[:blank:]])/}" ) # remove leading space/tab from each element +NAMESERVERS=( "${NAMESERVERS[@]/%+([[:blank:]])/}" ) # remove trailing space/tab from each element +# BUILD LIST OF IPV4 DNS PROVIDERS PROVIDERSV4=" -1.1.1.1#cloudflare -4.2.2.1#level3 -8.8.8.8#google -9.9.9.9#quad9 -80.80.80.80#freenom -208.67.222.123#opendns -199.85.126.20#norton -185.228.168.168#cleanbrowsing -77.88.8.7#yandex -176.103.130.132#adguard -156.154.70.3#neustar -8.26.56.26#comodo -45.90.28.202#nextdns +# NOTABLE IP4 DNS PROVIDERS + 94.140.14.14#AdGuard/1 + 94.140.15.15#AdGuard/2 + 185.228.168.9#CleanBrowsing/1 + 185.228.169.9#CleanBrowsing/2 + 1.1.1.1#Cloudflare/1 + 1.0.0.1#Cloudflare/2 + 8.26.56.26#Comodo/1 + 8.20.247.20#Comodo/2 + 84.200.69.80#DNS.Watch/1 + 84.200.70.40#DNS.Watch/2 + 8.8.8.8#Google/1 + 8.8.4.4#Google/2 + 4.2.2.1#Level3/1 + 4.2.2.2#Level3/2 + 64.6.64.6#Neustar/1 + 64.6.65.6#Neustar/2 + 208.67.222.222#OpenDNS/1 + 208.67.220.220#OpenDNS/2 + 216.146.35.35#OracleDyn/1 + 216.146.36.36#OracleDyn/2 + 9.9.9.9#Quad9/1 + 149.112.112.112#Quad9/2 + +# OTHER IP4 DNS PROVIDERS + 76.76.19.19#AlternateDNS/1 + 76.223.122.150#AlternateDNS/2 + 76.76.2.0#ControlD/1 + 76.76.10.0#ControlD/2 + 103.247.36.36#DNSFilter/1 + 103.247.37.37#DNSFilter/2 + 80.80.80.80#Freenom/1 + 80.80.81.81#Freenom/2 + 45.90.28.243#NextDNS/1 + 45.90.30.243#NextDNS/2 + 199.85.126.10#NortonCS/1 + 199.85.127.10#NortonCS/2 + 195.46.39.39#SafeDNS/1 + 195.46.39.40#SafeDNS/2 + 64.6.64.6#Verisign/1 + 64.6.65.6#Verisign/2 + 77.88.8.8#Yandex/1 + 77.88.8.1#Yandex/2 " +# SORT PROVIDERSV4 ARRAY +IFS=$'\n' PROVIDERSV4=($(sort -t "#" -k 2,2 <<<"${PROVIDERSV4[@]}")); unset IFS +# BUILD LIST OF IPV6 DNS PROVIDERS PROVIDERSV6=" -2606:4700:4700::1111#cloudflare-v6 -2001:4860:4860::8888#google-v6 -2620:fe::fe#quad9-v6 -2620:119:35::35#opendns-v6 -2a0d:2a00:1::1#cleanbrowsing-v6 -2a02:6b8::feed:0ff#yandex-v6 -2a00:5a60::ad1:0ff#adguard-v6 -2610:a1:1018::3#neustar-v6 -" +# NOTABLE IP6 DNS PROVIDERS + 2a10:50c0::ad1:ff#AdGuard/1-v6 + 2a10:50c0::ad2:ff#AdGuard/2-v6 + 2a0d:2a00:1::2#CleanBrowsing/1-v6 + 2a0d:2a00:2::2#CleanBrowsing/2-v6 + 2606:4700:4700::1111#Cloudflare/1-v6 + 2606:4700:4700::1001#Cloudflare/2-v6 +2001:1608:10:25::1c04:b12f#DNS.Watch/1 +2001:1608:10:25::9249:d69b#DNS.Watch/2 + 2001:4860:4860::8888#Google/1-v6 + 2001:4860:4860::8844#Google/2-v6 + 2620:74:1b::1:1#Neustar/1 + 2620:74:1c::2:2#Neustar/2 + 2620:119:35::35#OpenDNS/1-v6 + 2620:119:53::53#OpenDNS/2-v6 + 2620:fe::fe#Quad9/1-v6 + 2620:fe::9#Quad9/2-v6 -# Testing for IPv6 -$dig +short +tries=1 +time=2 +stats @2a0d:2a00:1::1 www.google.com |grep 216.239.38.120 >/dev/null 2>&1 -if [ $? = 0 ]; then - hasipv6="true" -fi +# OTHER IP6 DNS PROVIDERS + 2602:fcbc::ad#AlternateDNS/1-v6 + 2602:fcbc:2::ad#AlternateDNS/2-v6 + 2606:1a40::#ControlD/1-v6 + 2606:1a40:1::#ControlD/2-v6 + 2a07:a8c0::11:b227#NextDNS/1-v6 + 2a07:a8c1::11:b227#NextDNS/2-v6 + 2001:67c:2778::3939#SafeDNS/1-v6 + 2001:67c:2778::3939#SafeDNS/2-v6 + 2a02:6b8::feed:0ff#Yandex/1-v6 + 2a02:6b8:0:1::feed:0ff#Yandex/2-v6 +" +# SORT PROVIDERSV6 ARRAY +IFS=$'\n' PROVIDERSV6=($(sort -t "#" -k 2,2 <<<"${PROVIDERSV6[@]}")); unset IFS -providerstotest=$PROVIDERSV4 +# BUILD LIST OF DOMAINS TO TEST AGAINST +DOMAINS2TEST=" +# TOP 9 WEBSITES 2022 + www.google.com + www.youtube.com + www.facebook.com + www.amazon.com + www.reddit.com + www.apple.com + www.pornhub.com + www.yahoo.com + www.wikipedia.org -if [ "x$1" = "xipv6" ]; then - if [ "x$hasipv6" = "x" ]; then - echo "error: IPv6 support not found. Unable to do the ipv6 test."; exit 1; - fi - providerstotest=$PROVIDERSV6 +# OTHER TOP WEBSITES 2022 +# www.twitter.com +# www.paypal.com +# www.xvideos.com +# www.instagram.com +# www.bing.com +# www.fandom.com +# www.microsoftonline.com +# www.walmart.com +# www.spankbang.com +# www.twitch.tv +# www.tiktok.com +# www.linkedin.com +# www.duckduckgo.com +# www.weather.com +# www.indeed.com +# www.qccerttest.com +# www.quora.com +# www.ebay.com +# www.xnxx.com +# www.cnn.com +# www.espn.com +# www.xhamster.com +# www.etsy.com +# www.nytimes.com +# www.imdb.com +# www.redd.it +# www.usps.com +# www.office.com +# www.microsoft.com +# www.zillow.com +# www.live.com +" +# SORT DOMAINS2TEST ARRAY +IFS=$'\n' DOMAINS2TEST=($(sort -u <<<"${DOMAINS2TEST[@]}")); unset IFS -elif [ "x$1" = "xipv4" ]; then - providerstotest=$PROVIDERSV4 +# SANITIZE DOMAINS2TEST ARRAY +shopt -s extglob # turn on extended glob +DOMAINS2TEST=( "${DOMAINS2TEST[@]/#+([[:blank:]])/}" ) # remove leading space/tab from each element +DOMAINS2TEST=( "${DOMAINS2TEST[@]/%+([[:blank:]])/}" ) # remove trailing space/tab from each element -elif [ "x$1" = "xall" ]; then - if [ "x$hasipv6" = "x" ]; then - providerstotest=$PROVIDERSV4 - else - providerstotest="$PROVIDERSV4 $PROVIDERSV6" - fi +if [ "$1" = "ipv6" ]; then + providerstotest=("${PROVIDERSV6[@]}") +elif [ "$1" = "ipv4" ]; then + providerstotest=("${PROVIDERSV4[@]}") +elif [ "$1" = "all" ]; then + providerstotest=("${PROVIDERSV4[@]}" "${PROVIDERSV6[@]}") else - providerstotest=$PROVIDERSV4 + providerstotest=("${PROVIDERSV4[@]}") fi +if [ "$1" = "host" ]; then + providerstotest=("${NAMESERVERS[@]}") +elif [ "$1" = "-host" ]; then + providerstotest=("${providerstotest[@]}") +else + providerstotest=("${NAMESERVERS[@]}" "${providerstotest[@]}") +fi +# SANITIZE NAMESERVERS ARRAY +shopt -s extglob # turn on extended glob +providerstotest=( "${providerstotest[@]/#+([[:blank:]])/}" ) # remove leading space/tab from each element +providerstotest=( "${providerstotest[@]/%+([[:blank:]])/}" ) # remove trailing space/tab from each element - - -# Domains to test. Duplicated domains are ok -DOMAINS2TEST="www.google.com amazon.com facebook.com www.youtube.com www.reddit.com wikipedia.org twitter.com gmail.com www.google.com whatsapp.com" - +# DETERMINE NAMESERVERS NAME LENGTH ($nsl) +for item in "${providerstotest[@]}"; do +if [[ -n "$item" ]] && [[ ! $item =~ ^#.* ]]; then + pname=${item##*#} + plength[${#pname}]=${item##*#} # use word length as index +fi +done +longest=("${plength[@]: -1}") # select last array element +length=$((${#longest})) +nsl="%-$((${#longest} + 1))s" +echo totaldomains=0 -printf "%-21s" "" -for d in $DOMAINS2TEST; do - totaldomains=$((totaldomains + 1)) - printf "%-8s" "test$totaldomains" +eval printf '$nsl' "Provider" +for d in "${DOMAINS2TEST[@]}"; do +if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then + totaldomains=$((totaldomains + 1)) + printf "%-4s" "t$totaldomains" +fi +done +printf "%9s\n" "Median ms" +eval printf -- '-%.0s' "{1..$length}" +printf ' %.0s' "" +for d in "${DOMAINS2TEST[@]}"; do +if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then + printf "%-4s" "---" +fi done -printf "%-8s" "Average" -echo "" +printf "%-4s\n" "---------" +for p in "${providerstotest[@]}"; do +if [[ -n "$p" ]] && [[ ! $p =~ ^#.* ]]; then -for p in $NAMESERVERS $providerstotest; do pip=${p%%#*} pname=${p##*#} ftime=0 + xtime=0 + + eval printf '$nsl' "$pname" + for d in "${DOMAINS2TEST[@]}"; do + if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then + + ttime=$(dig +tries=1 +timeout=1 @"$pip" "$d" | grep "Query time:" | awk '{ print $4 }') + + + # NSLOOKUP INSTEAD OF DIG + # TEST=$((time (nslookup -timeout=1 -retry=0 www.microsoft.com 89.233.43.71)) 2>&1) + # echo "$TEST" | grep "connection timed out" + # echo "$TEST" | grep "real" + - printf "%-21s" "$pname" - for d in $DOMAINS2TEST; do - ttime=`$dig +tries=1 +time=2 +stats @$pip $d |grep "Query time:" | cut -d : -f 2- | cut -d " " -f 2` - if [ -z "$ttime" ]; then - #let's have time out be 1s = 1000ms - ttime=1000 - elif [ "x$ttime" = "x0" ]; then - ttime=1 - fi - - printf "%-8s" "$ttime ms" - ftime=$((ftime + ttime)) + + if [ -z "$ttime" ]; then + #let's have time out be 1s = 1000ms + ttime=1000 + elif [ "$ttime" = "0" ]; then + ttime=1 + fi + + if [ "$ttime" -ge "1000" ]; then + printf "%-4s" "*" + xtime=$(( xtime+1 )) + else + printf "%-4s" "$ttime" + fi + + ftime=$((ftime + ttime)) + + fi done - avg=`bc -l <<< "scale=2; $ftime/$totaldomains"` + avg=$(awk -v a="$ftime" -v b="$totaldomains" 'BEGIN { printf "%.2f", a/b }' Date: Fri, 28 Apr 2023 05:41:46 -0700 Subject: [PATCH 02/20] Major changes to information format/display 1. Code syntax revisions/compressions 2. Default display optimized for testing 13 domain names for median response times 3. Added more default domains to test 4. Added more default DNS providers to test 5. Automatically display output sorted by fastest median response time 6. Automatically save sorted list to file --- dnstest.sh | 122 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 79 insertions(+), 43 deletions(-) diff --git a/dnstest.sh b/dnstest.sh index 65a2bc2..d39ecdd 100755 --- a/dnstest.sh +++ b/dnstest.sh @@ -37,9 +37,9 @@ if LOCALTEST=$(netstat -tulpnW | grep "\:53\b" | grep "tcp\b" | grep "LISTEN"); NAMESERVERS=("${LOCALHOST}" "${NAMESERVERS[@]}") fi # SANITIZE NAMESERVERS ARRAY -shopt -s extglob # turn on extended glob -NAMESERVERS=( "${NAMESERVERS[@]/#+([[:blank:]])/}" ) # remove leading space/tab from each element -NAMESERVERS=( "${NAMESERVERS[@]/%+([[:blank:]])/}" ) # remove trailing space/tab from each element +shopt -s extglob # turn on extended glob +NAMESERVERS=("${NAMESERVERS[@]/#+([[:blank:]])/}") # remove leading space/tab from each element +NAMESERVERS=("${NAMESERVERS[@]/%+([[:blank:]])/}") # remove trailing space/tab from each element # BUILD LIST OF IPV4 DNS PROVIDERS PROVIDERSV4=" @@ -82,6 +82,8 @@ PROVIDERSV4=" 199.85.127.10#NortonCS/2 195.46.39.39#SafeDNS/1 195.46.39.40#SafeDNS/2 + 91.239.100.100#UncensoredDNS/1 + 89.233.43.71#UncensoredDNS/2 64.6.64.6#Verisign/1 64.6.65.6#Verisign/2 77.88.8.8#Yandex/1 @@ -119,6 +121,8 @@ PROVIDERSV6=" 2a07:a8c1::11:b227#NextDNS/2-v6 2001:67c:2778::3939#SafeDNS/1-v6 2001:67c:2778::3939#SafeDNS/2-v6 + 2001:67c:28a4::#UncensoredDNS/1 + 2a01:3a0:53:53::#UncensoredDNS/2 2a02:6b8::feed:0ff#Yandex/1-v6 2a02:6b8:0:1::feed:0ff#Yandex/2-v6 " @@ -127,81 +131,88 @@ IFS=$'\n' PROVIDERSV6=($(sort -t "#" -k 2,2 <<<"${PROVIDERSV6[@]}")); unset IFS # BUILD LIST OF DOMAINS TO TEST AGAINST DOMAINS2TEST=" -# TOP 9 WEBSITES 2022 +# 13 TESTS OR LESS SHOULD FIT WITHIN 80 CHARACTER TERMINAL DISPLAY www.google.com www.youtube.com www.facebook.com www.amazon.com www.reddit.com www.apple.com - www.pornhub.com www.yahoo.com www.wikipedia.org + www.twitter.com + www.paypal.com + docker.io + github.com + gmail.com -# OTHER TOP WEBSITES 2022 -# www.twitter.com -# www.paypal.com -# www.xvideos.com -# www.instagram.com +# OTHER TOP/POPULAR WEBSITES TO TEST AGAINST # www.bing.com # www.fandom.com # www.microsoftonline.com # www.walmart.com -# www.spankbang.com -# www.twitch.tv -# www.tiktok.com -# www.linkedin.com # www.duckduckgo.com # www.weather.com # www.indeed.com # www.qccerttest.com # www.quora.com # www.ebay.com -# www.xnxx.com # www.cnn.com # www.espn.com -# www.xhamster.com # www.etsy.com # www.nytimes.com # www.imdb.com -# www.redd.it # www.usps.com # www.office.com # www.microsoft.com # www.zillow.com # www.live.com +# www.plex.tv + +# SOCIAL NETWORKING SITES +# www.instagram.com +# www.twitch.tv +# www.tiktok.com +# www.linkedin.com + +# PORN SITES +# www.pornhub.com +# www.xvideos.com +# www.xnxx.com +# www.spankbang.com +# www.xhamster.com " # SORT DOMAINS2TEST ARRAY IFS=$'\n' DOMAINS2TEST=($(sort -u <<<"${DOMAINS2TEST[@]}")); unset IFS # SANITIZE DOMAINS2TEST ARRAY -shopt -s extglob # turn on extended glob -DOMAINS2TEST=( "${DOMAINS2TEST[@]/#+([[:blank:]])/}" ) # remove leading space/tab from each element -DOMAINS2TEST=( "${DOMAINS2TEST[@]/%+([[:blank:]])/}" ) # remove trailing space/tab from each element +shopt -s extglob # turn on extended glob +DOMAINS2TEST=("${DOMAINS2TEST[@]/#+([[:blank:]])/}") # remove leading space/tab from each element +DOMAINS2TEST=("${DOMAINS2TEST[@]/%+([[:blank:]])/}") # remove trailing space/tab from each element if [ "$1" = "ipv6" ]; then - providerstotest=("${PROVIDERSV6[@]}") + PROVIDERSTOTEST=("${PROVIDERSV6[@]}") elif [ "$1" = "ipv4" ]; then - providerstotest=("${PROVIDERSV4[@]}") + PROVIDERSTOTEST=("${PROVIDERSV4[@]}") elif [ "$1" = "all" ]; then - providerstotest=("${PROVIDERSV4[@]}" "${PROVIDERSV6[@]}") + PROVIDERSTOTEST=("${PROVIDERSV4[@]}" "${PROVIDERSV6[@]}") else - providerstotest=("${PROVIDERSV4[@]}") + PROVIDERSTOTEST=("${PROVIDERSV4[@]}") fi if [ "$1" = "host" ]; then - providerstotest=("${NAMESERVERS[@]}") + PROVIDERSTOTEST=("${NAMESERVERS[@]}") elif [ "$1" = "-host" ]; then - providerstotest=("${providerstotest[@]}") + PROVIDERSTOTEST=("${PROVIDERSTOTEST[@]}") else - providerstotest=("${NAMESERVERS[@]}" "${providerstotest[@]}") + PROVIDERSTOTEST=("${NAMESERVERS[@]}" "${PROVIDERSTOTEST[@]}") fi # SANITIZE NAMESERVERS ARRAY -shopt -s extglob # turn on extended glob -providerstotest=( "${providerstotest[@]/#+([[:blank:]])/}" ) # remove leading space/tab from each element -providerstotest=( "${providerstotest[@]/%+([[:blank:]])/}" ) # remove trailing space/tab from each element +shopt -s extglob # turn on extended glob +PROVIDERSTOTEST=("${PROVIDERSTOTEST[@]/#+([[:blank:]])/}") # remove leading space/tab from each element +PROVIDERSTOTEST=("${PROVIDERSTOTEST[@]/%+([[:blank:]])/}") # remove trailing space/tab from each element # DETERMINE NAMESERVERS NAME LENGTH ($nsl) -for item in "${providerstotest[@]}"; do +for item in "${PROVIDERSTOTEST[@]}"; do if [[ -n "$item" ]] && [[ ! $item =~ ^#.* ]]; then pname=${item##*#} plength[${#pname}]=${item##*#} # use word length as index @@ -212,7 +223,22 @@ length=$((${#longest})) nsl="%-$((${#longest} + 1))s" echo -totaldomains=0 +echo TESTING DOMAINS: +echo +echo Test Domain Name +echo ---- --------------- +for d in "${DOMAINS2TEST[@]}"; do +if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then + totaldomains=$((totaldomains + 1)) + printf "%3s: %s\n" "t$totaldomains" "$d" +fi +done +unset totaldomains + +echo +echo ALPHABETICAL TESTING: +echo +# totaldomains=0 eval printf '$nsl' "Provider" for d in "${DOMAINS2TEST[@]}"; do if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then @@ -230,7 +256,14 @@ fi done printf "%-4s\n" "---------" -for p in "${providerstotest[@]}"; do + + +# REDIRECT STDOUT TO TEE IN ORDER TO DUPLICATE THE OUTPUT TO THE TERMINAL AS WELL AS A .LOG FILE +exec > >(tee "$0.log") + + + +for p in "${PROVIDERSTOTEST[@]}"; do if [[ -n "$p" ]] && [[ ! $p =~ ^#.* ]]; then pip=${p%%#*} @@ -245,6 +278,7 @@ if [[ -n "$p" ]] && [[ ! $p =~ ^#.* ]]; then ttime=$(dig +tries=1 +timeout=1 @"$pip" "$d" | grep "Query time:" | awk '{ print $4 }') + # NSLOOKUP INSTEAD OF DIG # TEST=$((time (nslookup -timeout=1 -retry=0 www.microsoft.com 89.233.43.71)) 2>&1) # echo "$TEST" | grep "connection timed out" @@ -261,7 +295,7 @@ if [[ -n "$p" ]] && [[ ! $p =~ ^#.* ]]; then if [ "$ttime" -ge "1000" ]; then printf "%-4s" "*" - xtime=$(( xtime+1 )) + xtime=$((xtime+1)) else printf "%-4s" "$ttime" fi @@ -273,7 +307,7 @@ if [[ -n "$p" ]] && [[ ! $p =~ ^#.* ]]; then avg=$(awk -v a="$ftime" -v b="$totaldomains" 'BEGIN { printf "%.2f", a/b }' /dev/tty 2>&1 - totaldomains=$((totaldomains + 1)) - printf "%3s: %s\n" "t$totaldomains" "$d" -fi -done +# SORT THE OUTPUT BY FASTEST MEDIAN RESPONSE TIME +read first_line < "$0".log +num_fields=$(echo "$first_line" | awk '{print NF}') +sort -k "$((num_fields - 1))" -k "$num_fields" -n "$0".log -o "$0".sorted.log +echo +echo RESULTS SORTED BY MEDIAN RESPONSE TIME: echo +cat "$0".sorted.log +echo # exit 0; From 902299b9a408655fb961f97d99215135b761bdde Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Fri, 28 Apr 2023 06:15:26 -0700 Subject: [PATCH 03/20] Made log read safer with '-r' --- dnstest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnstest.sh b/dnstest.sh index d39ecdd..7884b87 100755 --- a/dnstest.sh +++ b/dnstest.sh @@ -320,7 +320,7 @@ done exec > /dev/tty 2>&1 # SORT THE OUTPUT BY FASTEST MEDIAN RESPONSE TIME -read first_line < "$0".log +read -r first_line < "$0".log num_fields=$(echo "$first_line" | awk '{print NF}') sort -k "$((num_fields - 1))" -k "$num_fields" -n "$0".log -o "$0".sorted.log From eec023dd0ce6dd0f08fcf77dd8c5bed34dcde1cb Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Fri, 28 Apr 2023 06:37:01 -0700 Subject: [PATCH 04/20] Revised basics of how different this version is This documentation is super basic. I need to come back to this and make proper write-ups of what has been changed and how it works. But the example output should make a lot of it obvious once you use the script or if you have experience with the original version. --- README.md | 274 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 160 insertions(+), 114 deletions(-) diff --git a/README.md b/README.md index 92150a5..d7c9b0d 100644 --- a/README.md +++ b/README.md @@ -2,123 +2,169 @@ Shell script to test the performance of the most popular DNS resolvers from your location. -Includes by default: - * CloudFlare 1.1.1.1 - * Level3 4.2.2.1 - * Google 8.8.8.8 - * Quad9 9.9.9.9 - * Freenom 80.80.80.80 - * OpenDNS - * Norton - * CleanBrowsing - * Yandex - * AdGuard - * Neustar - * Comodo - * NextDNS +Includes the redundant servers of notable DNS providers by default: + +* AdGuard +* CleanBrowsing +* Cloudflare (1.1.1.1) +* Comodo +* DNS.Watch +* Google (8.8.8.8) +* Level3 (4.2.2.1) +* Neustar +* OpenDNS (208.67.222.222) +* OracleDyn +* Quad9 (9.9.9.9) + +As well as the redundant servers of these other well-known providers: + +* AlternateDNS +* ControlD +* DNSFilter +* Freenom +* NextDNS +* NortonCS +* SafeDNS +* UncensoredDNS +* Verisign +* Yandex + +13 default domain names are tested, with many others available as toggleable in the code: + +* docker.io +* github.com +* gmail.com +* www.amazon.com +* www.apple.com +* www.facebook.com +* www.google.com +* www.paypal.com +* www.reddit.com +* www.twitter.com +* www.wikipedia.org +* www.yahoo.com +* www.youtube.com # Required -You need to install bc and dig. +You need to install `dig`. `bc` is no longer a requirement. -For Ubuntu: +# Utilization and example output: -``` - $ sudo apt-get install bc dnsutils -``` - -For macOS using homebrew: - -``` - $ brew install bc bind -``` - -# Utilization - -``` - $ git clone --depth=1 https://github.com/cleanbrowsing/dnsperftest/ - $ cd dnsperftest - $ bash ./dnstest.sh - test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -cloudflare 1 ms 1 ms 1 ms 2 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.10 -google 22 ms 1 ms 4 ms 24 ms 1 ms 19 ms 3 ms 56 ms 21 ms 21 ms 17.20 -quad9 10 ms 19 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 55 ms 15.40 -opendns 39 ms 2 ms 2 ms 20 ms 2 ms 72 ms 2 ms 39 ms 39 ms 3 ms 22.00 -norton 2 ms 2 ms 2 ms 2 ms 1 ms 2 ms 2 ms 1 ms 2 ms 2 ms 1.80 -cleanbrowsing 11 ms 14 ms 11 ms 11 ms 10 ms 10 ms 11 ms 36 ms 11 ms 13 ms 13.80 -yandex 175 ms 209 ms 175 ms 181 ms 188 ms 179 ms 178 ms 179 ms 177 ms 208 ms 184.90 -adguard 200 ms 200 ms 200 ms 199 ms 202 ms 200 ms 202 ms 200 ms 199 ms 248 ms 205.00 -neustar 2 ms 2 ms 2 ms 2 ms 1 ms 2 ms 2 ms 2 ms 2 ms 2 ms 1.90 -comodo 21 ms 22 ms 22 ms 22 ms 22 ms 22 ms 22 ms 21 ms 22 ms 24 ms 22.00 -``` - -To sort with the fastest first, add `sort -k 22 -n` at the end of the command: - -``` - $ bash ./dnstest.sh |sort -k 22 -n - test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -cloudflare 1 ms 1 ms 1 ms 4 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.30 -norton 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2.00 -neustar 2 ms 2 ms 2 ms 2 ms 1 ms 2 ms 2 ms 2 ms 2 ms 22 ms 3.90 -cleanbrowsing 11 ms 23 ms 11 ms 11 ms 11 ms 11 ms 11 ms 13 ms 12 ms 11 ms 12.50 -google 4 ms 4 ms 3 ms 21 ms 21 ms 61 ms 3 ms 21 ms 21 ms 22 ms 18.10 -opendns 2 ms 2 ms 2 ms 39 ms 2 ms 75 ms 2 ms 21 ms 39 ms 13 ms 19.70 -comodo 22 ms 23 ms 22 ms 22 ms 22 ms 22 ms 22 ms 22 ms 22 ms 23 ms 22.20 -quad9 10 ms 37 ms 10 ms 10 ms 10 ms 145 ms 10 ms 10 ms 10 ms 20 ms 27.20 -yandex 177 ms 216 ms 178 ms 182 ms 186 ms 177 ms 183 ms 174 ms 186 ms 222 ms 188.10 -adguard 199 ms 210 ms 200 ms 201 ms 202 ms 202 ms 199 ms 200 ms 198 ms 201 ms 201.20 -``` - -To test using the IPv6 addresses, add the IPv6 option: - -``` - $ bash ./dnstest.sh ipv6| sort -k 22 -n - test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -cleanbrowsing-v6 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -cloudflare-v6 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 5 ms 1 ms 1 ms 1 ms 1.40 -quad9-v6 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 21 ms 3.00 -8.8.8.8 7 ms 1 ms 16 ms 1 ms 1 ms 24 ms 1 ms 8 ms 1 ms 7 ms 6.70 -neustar-v6 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 60 ms 6.90 -opendns-v6 1 ms 1 ms 1 ms 1 ms 1 ms 62 ms 1 ms 1 ms 29 ms 1 ms 9.90 -google-v6 8 ms 8 ms 7 ms 8 ms 14 ms 67 ms 1 ms 7 ms 8 ms 61 ms 18.90 -adguard-v6 52 ms 55 ms 52 ms 53 ms 52 ms 56 ms 52 ms 55 ms 52 ms 57 ms 53.60 -yandex-v6 177 ms 178 ms 178 ms 179 ms 179 ms 178 ms 179 ms 178 ms 178 ms 223 ms 182.70 -``` - -To test both IPv6 and IPv4, add the "all" option: -``` - $ bash ./dnstest.sh all| sort -k 22 -n - test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -cleanbrowsing 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -cleanbrowsing-v6 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -cloudflare-v6 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -neustar 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -nextdns 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -quad9-v6 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -cloudflare 1 ms 1 ms 1 ms 1 ms 1 ms 2 ms 1 ms 1 ms 1 ms 1 ms 1.10 -quad9 1 ms 1 ms 1 ms 2 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.10 -google 1 ms 1 ms 6 ms 1 ms 1 ms 6 ms 1 ms 7 ms 9 ms 7 ms 4.00 -8.8.8.8 6 ms 1 ms 25 ms 1 ms 1 ms 6 ms 1 ms 7 ms 1 ms 7 ms 5.60 -neustar-v6 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 64 ms 7.30 -opendns-v6 7 ms 1 ms 21 ms 8 ms 1 ms 1 ms 1 ms 6 ms 1 ms 29 ms 7.60 -opendns 1 ms 1 ms 27 ms 27 ms 1 ms 67 ms 1 ms 6 ms 1 ms 27 ms 15.90 -comodo 1 ms 1 ms 1 ms 1 ms 4 ms 1 ms 1 ms 1 ms 1 ms 150 ms 16.20 -google-v6 7 ms 6 ms 33 ms 7 ms 7 ms 87 ms 7 ms 8 ms 8 ms 25 ms 19.50 -level3 27 ms 26 ms 25 ms 27 ms 27 ms 25 ms 27 ms 27 ms 25 ms 28 ms 26.40 -norton 28 ms 26 ms 28 ms 26 ms 26 ms 28 ms 27 ms 27 ms 27 ms 27 ms 27.00 -adguard-v6 52 ms 54 ms 55 ms 56 ms 52 ms 52 ms 52 ms 53 ms 53 ms 54 ms 53.30 -adguard 58 ms 58 ms 58 ms 58 ms 60 ms 58 ms 60 ms 60 ms 58 ms 60 ms 58.80 -freenom 140 ms 140 ms 140 ms 145 ms 135 ms 140 ms 140 ms 140 ms 140 ms 134 ms 139.40 -yandex-v6 178 ms 179 ms 178 ms 179 ms 178 ms 178 ms 178 ms 179 ms 179 ms 205 ms 181.10 -yandex 178 ms 178 ms 177 ms 179 ms 178 ms 174 ms 180 ms 178 ms 179 ms 222 ms 182.30 - -``` - - -# For Windows users using the Linux subsystem - -If you receive an error `$'\r': command not found`, convert the file to a Linux-compatible line endings using: - - tr -d '\15\32' < dnstest.sh > dnstest-2.sh + # bash dnstest.sh + + TESTING DOMAINS: + + Test Domain Name + ---- --------------- + t1: docker.io + t2: github.com + t3: gmail.com + t4: www.amazon.com + t5: www.apple.com + t6: www.facebook.com + t7: www.google.com + t8: www.paypal.com + t9: www.reddit.com + t10: www.twitter.com + t11: www.wikipedia.org + t12: www.yahoo.com + t13: www.youtube.com + + ALPHABETICAL TESTING: + + Provider t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 Median ms + --------------- --- --- --- --- --- --- --- --- --- --- --- --- --- --------- + pihole-FTL 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00 ms + nameserver/1 52 21 48 120 30 17 17 19 19 19 85 17 18 37.08 ms + nameserver/2 54 50 21 31 30 30 19 22 22 20 77 20 19 31.92 ms + AdGuard/1 55 57 56 58 57 56 56 57 57 56 56 56 57 56.46 ms + AdGuard/2 57 55 56 57 62 57 56 56 58 57 52 56 60 56.85 ms + AlternateDNS/1 87 89 75 77 77 78 76 75 78 78 78 75 76 78.38 ms + AlternateDNS/2 75 74 77 78 76 76 80 77 75 74 77 78 76 76.38 ms + CleanBrowsing/1 88 81 80 81 84 80 81 83 81 81 80 81 79 81.54 ms + CleanBrowsing/2 78 55 56 54 55 54 54 53 56 62 54 52 53 56.62 ms + Cloudflare/1 42 42 44 46 43 46 48 45 45 44 45 46 45 44.69 ms + Cloudflare/2 44 46 46 45 47 48 45 44 44 45 45 45 46 45.38 ms + Comodo/1 30 33 28 30 28 28 30 31 34 30 30 29 29 30.00 ms + Comodo/2 30 29 30 30 30 31 31 27 25 29 32 30 31 29.62 ms + ControlD/1 22 29 20 22 29 20 19 22 22 19 20 24 20 22.15 ms + ControlD/2 21 20 22 22 22 19 20 21 20 21 20 18 20 20.46 ms + DNSFilter/1 18 19 18 20 19 20 17 18 20 23 20 22 21 19.62 ms + DNSFilter/2 14 14 22 17 20 20 19 19 20 20 20 20 21 18.92 ms + DNS.Watch/1 172 165 166 173 181 165 174 * 169 199 160 173 * 999 2-to + DNS.Watch/2 * 170 185 166 161 165 166 205 170 162 293 167 199 999 1-to + Freenom/1 231 284 309 377 247 194 194 479 339 333 585 269 194 310.38 ms + Freenom/2 313 356 291 381 * 195 195 301 354 398 670 195 195 999 1-to + Google/1 18 20 25 30 20 19 20 19 20 19 19 15 19 20.23 ms + Google/2 19 22 20 30 20 19 18 18 19 19 19 21 18 20.15 ms + Level3/1 19 19 17 18 17 19 17 18 18 18 23 16 17 18.15 ms + Level3/2 19 20 18 20 18 18 19 19 19 18 19 20 18 18.85 ms + Neustar/1 47 62 25 27 26 26 26 25 27 27 26 25 24 30.23 ms + Neustar/2 16 17 18 15 16 20 15 17 19 19 22 19 20 17.92 ms + NextDNS/1 20 21 20 20 20 19 20 20 19 20 20 20 20 19.92 ms + NextDNS/2 22 24 26 33 21 21 19 21 20 21 21 20 19 22.15 ms + NortonCS/1 21 19 19 19 22 20 22 20 20 19 21 21 18 20.08 ms + NortonCS/2 25 26 24 25 26 26 24 22 23 25 27 26 26 25.00 ms + OpenDNS/1 49 23 35 29 20 51 18 17 19 19 77 19 18 30.31 ms + OpenDNS/2 23 20 18 59 47 25 46 19 19 21 84 21 20 32.46 ms + OracleDyn/1 45 26 26 30 28 26 26 29 28 25 29 25 27 28.46 ms + OracleDyn/2 27 29 29 28 26 29 31 25 27 30 26 28 28 27.92 ms + Quad9/1 46 20 24 23 18 20 19 18 20 18 21 15 19 21.62 ms + Quad9/2 19 20 18 18 20 18 19 20 18 20 19 15 21 18.85 ms + SafeDNS/1 136 134 138 136 135 135 136 133 135 137 137 135 169 138.15 ms + SafeDNS/2 137 135 135 138 135 137 134 134 137 136 136 135 135 135.69 ms + UncensoredDNS/1 * * * * * * * * * * * * * 999 13-to + UncensoredDNS/2 * * * * * * * * * * * * * 999 13-to + Verisign/1 43 26 26 28 27 26 27 26 27 29 28 27 26 28.15 ms + Verisign/2 21 20 15 18 17 13 15 19 18 18 16 19 21 17.69 ms + Yandex/1 779 186 195 184 191 203 199 196 204 194 192 206 203 240.92 ms + Yandex/2 253 214 209 191 185 211 185 197 209 197 190 195 184 201.54 ms + + RESULTS SORTED BY MEDIAN RESPONSE TIME: -Then run `bash ./dnstest-2.sh` + pihole-FTL 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00 ms + Verisign/2 21 20 15 18 17 13 15 19 18 18 16 19 21 17.69 ms + Neustar/2 16 17 18 15 16 20 15 17 19 19 22 19 20 17.92 ms + Level3/1 19 19 17 18 17 19 17 18 18 18 23 16 17 18.15 ms + Level3/2 19 20 18 20 18 18 19 19 19 18 19 20 18 18.85 ms + Quad9/2 19 20 18 18 20 18 19 20 18 20 19 15 21 18.85 ms + DNSFilter/2 14 14 22 17 20 20 19 19 20 20 20 20 21 18.92 ms + DNSFilter/1 18 19 18 20 19 20 17 18 20 23 20 22 21 19.62 ms + NextDNS/1 20 21 20 20 20 19 20 20 19 20 20 20 20 19.92 ms + NortonCS/1 21 19 19 19 22 20 22 20 20 19 21 21 18 20.08 ms + Google/2 19 22 20 30 20 19 18 18 19 19 19 21 18 20.15 ms + Google/1 18 20 25 30 20 19 20 19 20 19 19 15 19 20.23 ms + ControlD/2 21 20 22 22 22 19 20 21 20 21 20 18 20 20.46 ms + Quad9/1 46 20 24 23 18 20 19 18 20 18 21 15 19 21.62 ms + ControlD/1 22 29 20 22 29 20 19 22 22 19 20 24 20 22.15 ms + NextDNS/2 22 24 26 33 21 21 19 21 20 21 21 20 19 22.15 ms + NortonCS/2 25 26 24 25 26 26 24 22 23 25 27 26 26 25.00 ms + OracleDyn/2 27 29 29 28 26 29 31 25 27 30 26 28 28 27.92 ms + Verisign/1 43 26 26 28 27 26 27 26 27 29 28 27 26 28.15 ms + OracleDyn/1 45 26 26 30 28 26 26 29 28 25 29 25 27 28.46 ms + Comodo/2 30 29 30 30 30 31 31 27 25 29 32 30 31 29.62 ms + Comodo/1 30 33 28 30 28 28 30 31 34 30 30 29 29 30.00 ms + Neustar/1 47 62 25 27 26 26 26 25 27 27 26 25 24 30.23 ms + OpenDNS/1 49 23 35 29 20 51 18 17 19 19 77 19 18 30.31 ms + nameserver/2 54 50 21 31 30 30 19 22 22 20 77 20 19 31.92 ms + OpenDNS/2 23 20 18 59 47 25 46 19 19 21 84 21 20 32.46 ms + nameserver/1 52 21 48 120 30 17 17 19 19 19 85 17 18 37.08 ms + Cloudflare/1 42 42 44 46 43 46 48 45 45 44 45 46 45 44.69 ms + Cloudflare/2 44 46 46 45 47 48 45 44 44 45 45 45 46 45.38 ms + AdGuard/1 55 57 56 58 57 56 56 57 57 56 56 56 57 56.46 ms + CleanBrowsing/2 78 55 56 54 55 54 54 53 56 62 54 52 53 56.62 ms + AdGuard/2 57 55 56 57 62 57 56 56 58 57 52 56 60 56.85 ms + AlternateDNS/2 75 74 77 78 76 76 80 77 75 74 77 78 76 76.38 ms + AlternateDNS/1 87 89 75 77 77 78 76 75 78 78 78 75 76 78.38 ms + CleanBrowsing/1 88 81 80 81 84 80 81 83 81 81 80 81 79 81.54 ms + SafeDNS/2 137 135 135 138 135 137 134 134 137 136 136 135 135 135.69 ms + SafeDNS/1 136 134 138 136 135 135 136 133 135 137 137 135 169 138.15 ms + Yandex/2 253 214 209 191 185 211 185 197 209 197 190 195 184 201.54 ms + Yandex/1 779 186 195 184 191 203 199 196 204 194 192 206 203 240.92 ms + Freenom/1 231 284 309 377 247 194 194 479 339 333 585 269 194 310.38 ms + DNS.Watch/2 * 170 185 166 161 165 166 205 170 162 293 167 199 999 1-to + Freenom/2 313 356 291 381 * 195 195 301 354 398 670 195 195 999 1-to + DNS.Watch/1 172 165 166 173 181 165 174 * 169 199 160 173 * 999 2-to + UncensoredDNS/1 * * * * * * * * * * * * * 999 13-to + UncensoredDNS/2 * * * * * * * * * * * * * 999 13-to From 977d65799c61ee20b7dcf8abe1cd25663aaf18b9 Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Sun, 30 Apr 2023 09:11:54 -0700 Subject: [PATCH 05/20] Updated log example to reflect recent changes --- README.md | 173 +++++++++++++++++++++++++++--------------------------- 1 file changed, 88 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index d7c9b0d..bb0c6d5 100644 --- a/README.md +++ b/README.md @@ -76,95 +76,98 @@ You need to install `dig`. `bc` is no longer a requirement. Provider t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 Median ms --------------- --- --- --- --- --- --- --- --- --- --- --- --- --- --------- pihole-FTL 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00 ms - nameserver/1 52 21 48 120 30 17 17 19 19 19 85 17 18 37.08 ms - nameserver/2 54 50 21 31 30 30 19 22 22 20 77 20 19 31.92 ms - AdGuard/1 55 57 56 58 57 56 56 57 57 56 56 56 57 56.46 ms - AdGuard/2 57 55 56 57 62 57 56 56 58 57 52 56 60 56.85 ms - AlternateDNS/1 87 89 75 77 77 78 76 75 78 78 78 75 76 78.38 ms - AlternateDNS/2 75 74 77 78 76 76 80 77 75 74 77 78 76 76.38 ms - CleanBrowsing/1 88 81 80 81 84 80 81 83 81 81 80 81 79 81.54 ms - CleanBrowsing/2 78 55 56 54 55 54 54 53 56 62 54 52 53 56.62 ms - Cloudflare/1 42 42 44 46 43 46 48 45 45 44 45 46 45 44.69 ms - Cloudflare/2 44 46 46 45 47 48 45 44 44 45 45 45 46 45.38 ms - Comodo/1 30 33 28 30 28 28 30 31 34 30 30 29 29 30.00 ms - Comodo/2 30 29 30 30 30 31 31 27 25 29 32 30 31 29.62 ms - ControlD/1 22 29 20 22 29 20 19 22 22 19 20 24 20 22.15 ms - ControlD/2 21 20 22 22 22 19 20 21 20 21 20 18 20 20.46 ms - DNSFilter/1 18 19 18 20 19 20 17 18 20 23 20 22 21 19.62 ms - DNSFilter/2 14 14 22 17 20 20 19 19 20 20 20 20 21 18.92 ms - DNS.Watch/1 172 165 166 173 181 165 174 * 169 199 160 173 * 999 2-to - DNS.Watch/2 * 170 185 166 161 165 166 205 170 162 293 167 199 999 1-to - Freenom/1 231 284 309 377 247 194 194 479 339 333 585 269 194 310.38 ms - Freenom/2 313 356 291 381 * 195 195 301 354 398 670 195 195 999 1-to - Google/1 18 20 25 30 20 19 20 19 20 19 19 15 19 20.23 ms - Google/2 19 22 20 30 20 19 18 18 19 19 19 21 18 20.15 ms - Level3/1 19 19 17 18 17 19 17 18 18 18 23 16 17 18.15 ms - Level3/2 19 20 18 20 18 18 19 19 19 18 19 20 18 18.85 ms - Neustar/1 47 62 25 27 26 26 26 25 27 27 26 25 24 30.23 ms - Neustar/2 16 17 18 15 16 20 15 17 19 19 22 19 20 17.92 ms - NextDNS/1 20 21 20 20 20 19 20 20 19 20 20 20 20 19.92 ms - NextDNS/2 22 24 26 33 21 21 19 21 20 21 21 20 19 22.15 ms - NortonCS/1 21 19 19 19 22 20 22 20 20 19 21 21 18 20.08 ms - NortonCS/2 25 26 24 25 26 26 24 22 23 25 27 26 26 25.00 ms - OpenDNS/1 49 23 35 29 20 51 18 17 19 19 77 19 18 30.31 ms - OpenDNS/2 23 20 18 59 47 25 46 19 19 21 84 21 20 32.46 ms - OracleDyn/1 45 26 26 30 28 26 26 29 28 25 29 25 27 28.46 ms - OracleDyn/2 27 29 29 28 26 29 31 25 27 30 26 28 28 27.92 ms - Quad9/1 46 20 24 23 18 20 19 18 20 18 21 15 19 21.62 ms - Quad9/2 19 20 18 18 20 18 19 20 18 20 19 15 21 18.85 ms - SafeDNS/1 136 134 138 136 135 135 136 133 135 137 137 135 169 138.15 ms - SafeDNS/2 137 135 135 138 135 137 134 134 137 136 136 135 135 135.69 ms + nameserver/1 49 21 64 82 79 20 19 19 20 19 74 20 19 38.85 ms + nameserver/2 50 69 52 29 30 22 21 20 21 19 49 19 22 32.54 ms + AdGuard/1 106 56 84 56 55 57 55 56 58 58 202 56 58 73.62 ms + AdGuard/2 56 55 56 57 58 58 58 56 57 57 58 58 56 56.92 ms + AlternateDNS/1 76 76 75 76 76 76 76 75 78 74 77 75 76 75.85 ms + AlternateDNS/2 76 76 80 76 76 77 72 73 77 78 78 76 76 76.23 ms + CleanBrowsing/1 97 81 79 81 80 80 82 83 79 84 81 80 83 82.31 ms + CleanBrowsing/2 57 55 56 55 55 55 53 57 55 55 56 56 55 55.38 ms + Cloudflare/1 50 47 49 45 48 48 46 48 48 50 48 50 45 47.85 ms + Cloudflare/2 49 48 49 49 46 44 49 48 48 49 45 49 46 47.62 ms + Comodo/1 30 29 31 30 32 30 32 31 30 30 149 28 31 39.46 ms + Comodo/2 30 25 30 30 30 31 31 30 30 30 30 31 33 30.08 ms + ControlD/1 24 20 35 22 32 21 21 61 21 26 182 21 21 39.00 ms + ControlD/2 21 21 19 20 22 21 19 22 20 21 20 20 19 20.38 ms + DNSFilter/1 19 17 18 19 19 20 18 17 19 20 20 20 19 18.85 ms + DNSFilter/2 21 22 21 18 19 20 20 22 21 22 21 19 20 20.46 ms + DNS.Watch/1 162 167 164 162 163 176 162 166 165 167 183 175 165 167.46 ms + DNS.Watch/2 159 160 165 166 164 182 167 162 * 162 170 161 166 999 1-to + Freenom/1 399 194 360 264 286 193 196 556 * 205 620 258 195 999 1-to + Freenom/2 412 191 311 507 288 195 195 205 301 235 614 724 194 336.31 ms + Google/1 20 20 18 29 23 19 18 19 18 17 55 17 19 22.46 ms + Google/2 17 21 26 61 23 19 18 18 20 21 18 19 21 23.23 ms + Level3/1 21 18 18 18 20 17 18 18 17 19 18 20 20 18.62 ms + Level3/2 19 17 16 18 19 18 17 21 17 20 21 16 20 18.38 ms + Neustar/1 61 27 28 24 28 25 26 27 27 28 28 27 26 29.38 ms + Neustar/2 18 20 19 38 21 20 21 18 19 19 19 19 21 20.92 ms + NextDNS/1 20 18 19 21 19 20 19 21 18 21 20 20 19 19.62 ms + NextDNS/2 54 21 19 20 14 20 21 22 20 21 21 21 20 22.62 ms + NortonCS/1 33 20 19 19 21 20 20 20 19 18 21 19 19 20.62 ms + NortonCS/2 43 29 26 24 27 24 27 26 27 25 26 27 27 27.54 ms + OpenDNS/1 21 21 34 48 29 19 20 18 20 19 79 18 20 28.15 ms + OpenDNS/2 22 22 37 60 19 30 18 19 19 19 18 19 21 24.85 ms + OracleDyn/1 39 29 27 24 25 27 25 23 29 30 25 30 28 27.77 ms + OracleDyn/2 40 31 28 27 27 27 28 32 29 26 27 28 28 29.08 ms + Quad9/1 21 20 21 19 21 20 20 19 18 19 20 19 19 19.69 ms + Quad9/2 18 22 19 24 19 20 21 21 19 21 19 20 20 20.23 ms + SafeDNS/1 137 136 146 163 135 135 146 137 134 132 135 136 176 142.15 ms + SafeDNS/2 136 135 134 136 136 135 137 136 135 135 135 135 135 135.38 ms UncensoredDNS/1 * * * * * * * * * * * * * 999 13-to UncensoredDNS/2 * * * * * * * * * * * * * 999 13-to - Verisign/1 43 26 26 28 27 26 27 26 27 29 28 27 26 28.15 ms - Verisign/2 21 20 15 18 17 13 15 19 18 18 16 19 21 17.69 ms - Yandex/1 779 186 195 184 191 203 199 196 204 194 192 206 203 240.92 ms - Yandex/2 253 214 209 191 185 211 185 197 209 197 190 195 184 201.54 ms + Verisign/1 33 28 29 27 28 27 27 27 27 27 28 27 25 27.69 ms + Verisign/2 21 18 19 19 14 18 18 19 18 20 21 20 20 18.85 ms + Yandex/1 203 210 202 197 192 201 206 204 623 199 202 198 185 232.46 ms + Yandex/2 194 187 189 190 195 207 188 214 209 186 206 202 187 196.46 ms - RESULTS SORTED BY MEDIAN RESPONSE TIME: + RESULTS SORTED BY MEDIAN RESPONSE TIME (dnstest.sh.sorted.log): + Provider t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 Median ms + --------------- --- --- --- --- --- --- --- --- --- --- --- --- --- --------- pihole-FTL 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00 ms - Verisign/2 21 20 15 18 17 13 15 19 18 18 16 19 21 17.69 ms - Neustar/2 16 17 18 15 16 20 15 17 19 19 22 19 20 17.92 ms - Level3/1 19 19 17 18 17 19 17 18 18 18 23 16 17 18.15 ms - Level3/2 19 20 18 20 18 18 19 19 19 18 19 20 18 18.85 ms - Quad9/2 19 20 18 18 20 18 19 20 18 20 19 15 21 18.85 ms - DNSFilter/2 14 14 22 17 20 20 19 19 20 20 20 20 21 18.92 ms - DNSFilter/1 18 19 18 20 19 20 17 18 20 23 20 22 21 19.62 ms - NextDNS/1 20 21 20 20 20 19 20 20 19 20 20 20 20 19.92 ms - NortonCS/1 21 19 19 19 22 20 22 20 20 19 21 21 18 20.08 ms - Google/2 19 22 20 30 20 19 18 18 19 19 19 21 18 20.15 ms - Google/1 18 20 25 30 20 19 20 19 20 19 19 15 19 20.23 ms - ControlD/2 21 20 22 22 22 19 20 21 20 21 20 18 20 20.46 ms - Quad9/1 46 20 24 23 18 20 19 18 20 18 21 15 19 21.62 ms - ControlD/1 22 29 20 22 29 20 19 22 22 19 20 24 20 22.15 ms - NextDNS/2 22 24 26 33 21 21 19 21 20 21 21 20 19 22.15 ms - NortonCS/2 25 26 24 25 26 26 24 22 23 25 27 26 26 25.00 ms - OracleDyn/2 27 29 29 28 26 29 31 25 27 30 26 28 28 27.92 ms - Verisign/1 43 26 26 28 27 26 27 26 27 29 28 27 26 28.15 ms - OracleDyn/1 45 26 26 30 28 26 26 29 28 25 29 25 27 28.46 ms - Comodo/2 30 29 30 30 30 31 31 27 25 29 32 30 31 29.62 ms - Comodo/1 30 33 28 30 28 28 30 31 34 30 30 29 29 30.00 ms - Neustar/1 47 62 25 27 26 26 26 25 27 27 26 25 24 30.23 ms - OpenDNS/1 49 23 35 29 20 51 18 17 19 19 77 19 18 30.31 ms - nameserver/2 54 50 21 31 30 30 19 22 22 20 77 20 19 31.92 ms - OpenDNS/2 23 20 18 59 47 25 46 19 19 21 84 21 20 32.46 ms - nameserver/1 52 21 48 120 30 17 17 19 19 19 85 17 18 37.08 ms - Cloudflare/1 42 42 44 46 43 46 48 45 45 44 45 46 45 44.69 ms - Cloudflare/2 44 46 46 45 47 48 45 44 44 45 45 45 46 45.38 ms - AdGuard/1 55 57 56 58 57 56 56 57 57 56 56 56 57 56.46 ms - CleanBrowsing/2 78 55 56 54 55 54 54 53 56 62 54 52 53 56.62 ms - AdGuard/2 57 55 56 57 62 57 56 56 58 57 52 56 60 56.85 ms - AlternateDNS/2 75 74 77 78 76 76 80 77 75 74 77 78 76 76.38 ms - AlternateDNS/1 87 89 75 77 77 78 76 75 78 78 78 75 76 78.38 ms - CleanBrowsing/1 88 81 80 81 84 80 81 83 81 81 80 81 79 81.54 ms - SafeDNS/2 137 135 135 138 135 137 134 134 137 136 136 135 135 135.69 ms - SafeDNS/1 136 134 138 136 135 135 136 133 135 137 137 135 169 138.15 ms - Yandex/2 253 214 209 191 185 211 185 197 209 197 190 195 184 201.54 ms - Yandex/1 779 186 195 184 191 203 199 196 204 194 192 206 203 240.92 ms - Freenom/1 231 284 309 377 247 194 194 479 339 333 585 269 194 310.38 ms - DNS.Watch/2 * 170 185 166 161 165 166 205 170 162 293 167 199 999 1-to - Freenom/2 313 356 291 381 * 195 195 301 354 398 670 195 195 999 1-to - DNS.Watch/1 172 165 166 173 181 165 174 * 169 199 160 173 * 999 2-to + Level3/2 19 17 16 18 19 18 17 21 17 20 21 16 20 18.38 ms + Level3/1 21 18 18 18 20 17 18 18 17 19 18 20 20 18.62 ms + DNSFilter/1 19 17 18 19 19 20 18 17 19 20 20 20 19 18.85 ms + Verisign/2 21 18 19 19 14 18 18 19 18 20 21 20 20 18.85 ms + NextDNS/1 20 18 19 21 19 20 19 21 18 21 20 20 19 19.62 ms + Quad9/1 21 20 21 19 21 20 20 19 18 19 20 19 19 19.69 ms + Quad9/2 18 22 19 24 19 20 21 21 19 21 19 20 20 20.23 ms + ControlD/2 21 21 19 20 22 21 19 22 20 21 20 20 19 20.38 ms + DNSFilter/2 21 22 21 18 19 20 20 22 21 22 21 19 20 20.46 ms + NortonCS/1 33 20 19 19 21 20 20 20 19 18 21 19 19 20.62 ms + Neustar/2 18 20 19 38 21 20 21 18 19 19 19 19 21 20.92 ms + Google/1 20 20 18 29 23 19 18 19 18 17 55 17 19 22.46 ms + NextDNS/2 54 21 19 20 14 20 21 22 20 21 21 21 20 22.62 ms + Google/2 17 21 26 61 23 19 18 18 20 21 18 19 21 23.23 ms + OpenDNS/2 22 22 37 60 19 30 18 19 19 19 18 19 21 24.85 ms + NortonCS/2 43 29 26 24 27 24 27 26 27 25 26 27 27 27.54 ms + Verisign/1 33 28 29 27 28 27 27 27 27 27 28 27 25 27.69 ms + OracleDyn/1 39 29 27 24 25 27 25 23 29 30 25 30 28 27.77 ms + OpenDNS/1 21 21 34 48 29 19 20 18 20 19 79 18 20 28.15 ms + OracleDyn/2 40 31 28 27 27 27 28 32 29 26 27 28 28 29.08 ms + Neustar/1 61 27 28 24 28 25 26 27 27 28 28 27 26 29.38 ms + Comodo/2 30 25 30 30 30 31 31 30 30 30 30 31 33 30.08 ms + nameserver/2 50 69 52 29 30 22 21 20 21 19 49 19 22 32.54 ms + nameserver/1 49 21 64 82 79 20 19 19 20 19 74 20 19 38.85 ms + ControlD/1 24 20 35 22 32 21 21 61 21 26 182 21 21 39.00 ms + Comodo/1 30 29 31 30 32 30 32 31 30 30 149 28 31 39.46 ms + Cloudflare/2 49 48 49 49 46 44 49 48 48 49 45 49 46 47.62 ms + Cloudflare/1 50 47 49 45 48 48 46 48 48 50 48 50 45 47.85 ms + CleanBrowsing/2 57 55 56 55 55 55 53 57 55 55 56 56 55 55.38 ms + AdGuard/2 56 55 56 57 58 58 58 56 57 57 58 58 56 56.92 ms + AdGuard/1 106 56 84 56 55 57 55 56 58 58 202 56 58 73.62 ms + AlternateDNS/1 76 76 75 76 76 76 76 75 78 74 77 75 76 75.85 ms + AlternateDNS/2 76 76 80 76 76 77 72 73 77 78 78 76 76 76.23 ms + CleanBrowsing/1 97 81 79 81 80 80 82 83 79 84 81 80 83 82.31 ms + SafeDNS/2 136 135 134 136 136 135 137 136 135 135 135 135 135 135.38 ms + SafeDNS/1 137 136 146 163 135 135 146 137 134 132 135 136 176 142.15 ms + DNS.Watch/1 162 167 164 162 163 176 162 166 165 167 183 175 165 167.46 ms + Yandex/2 194 187 189 190 195 207 188 214 209 186 206 202 187 196.46 ms + Yandex/1 203 210 202 197 192 201 206 204 623 199 202 198 185 232.46 ms + Freenom/2 412 191 311 507 288 195 195 205 301 235 614 724 194 336.31 ms + DNS.Watch/2 159 160 165 166 164 182 167 162 * 162 170 161 166 999 1-to + Freenom/1 399 194 360 264 286 193 196 556 * 205 620 258 195 999 1-to UncensoredDNS/1 * * * * * * * * * * * * * 999 13-to UncensoredDNS/2 * * * * * * * * * * * * * 999 13-to + From 8233385bf1994d0b508a04390d6b3da35954deaa Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Sun, 30 Apr 2023 09:16:01 -0700 Subject: [PATCH 06/20] Updated sorted log results 1. Added column header lines to output log 2. Refined median response time sort to compensate for column header lines 3. Refined syntax to scrape and process BASH_SOURCE[0] instead of $0 --- dnstest.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/dnstest.sh b/dnstest.sh index 7884b87..ecd5921 100755 --- a/dnstest.sh +++ b/dnstest.sh @@ -26,6 +26,11 @@ if ! command -v dig &> /dev/null; then exit 1 fi +# SCRAPE SCRIPT PATH INFO +SrceFllPth=$(readlink -f "${BASH_SOURCE[0]}") +SrceFolder=$(dirname "$SrceFllPth") +SrceFileNm=${SrceFllPth##*/} + # BUILD LIST OF NAMESERVERS USED BY THIS HOST NAMESERVERS=($(grep ^nameserver /etc/resolv.conf | awk 'BEGIN{i=0}{i++;}{print $2 "#" $1 "/" i}')) @@ -238,6 +243,10 @@ unset totaldomains echo echo ALPHABETICAL TESTING: echo + +# REDIRECT STDOUT TO TEE IN ORDER TO DUPLICATE THE OUTPUT TO THE TERMINAL AS WELL AS A .LOG FILE +exec > >(tee "$SrceFllPth.log") + # totaldomains=0 eval printf '$nsl' "Provider" for d in "${DOMAINS2TEST[@]}"; do @@ -256,13 +265,6 @@ fi done printf "%-4s\n" "---------" - - -# REDIRECT STDOUT TO TEE IN ORDER TO DUPLICATE THE OUTPUT TO THE TERMINAL AS WELL AS A .LOG FILE -exec > >(tee "$0.log") - - - for p in "${PROVIDERSTOTEST[@]}"; do if [[ -n "$p" ]] && [[ ! $p =~ ^#.* ]]; then @@ -319,14 +321,17 @@ done # CLOSE AND NORMALIZE THE LOGGING REDIRECTIONS exec > /dev/tty 2>&1 -# SORT THE OUTPUT BY FASTEST MEDIAN RESPONSE TIME -read -r first_line < "$0".log -num_fields=$(echo "$first_line" | awk '{print NF}') -sort -k "$((num_fields - 1))" -k "$num_fields" -n "$0".log -o "$0".sorted.log +# SORT THE LOGGED OUTPUT BY FASTEST MEDIAN RESPONSE TIME +read -r third_line < <(head -n 3 "$SrceFllPth".log | tail -n 1) +num_fields=$(echo "$third_line" | awk '{print NF}') +sort -k "$((num_fields - 1))" -k "$num_fields" -n "$SrceFllPth".log -o "$SrceFllPth".sorted.log +(tail -n +3 "$SrceFllPth".log | sort -k "$((num_fields - 1))" -k "$num_fields" -n) \ + | cat <(head -n 2 "$SrceFllPth".log) - > "$SrceFllPth".sorted.log echo -echo RESULTS SORTED BY MEDIAN RESPONSE TIME: +echo RESULTS SORTED BY MEDIAN RESPONSE TIME \("$SrceFileNm.sorted.log"\): echo -cat "$0".sorted.log +cat "$SrceFllPth".sorted.log echo + # exit 0; From df7f4969695d56cdfd75cf14b8020f7003cca4f6 Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 15:19:09 -0700 Subject: [PATCH 07/20] default target lists for tests --- dnstest.domains.txt | 50 +++++++++++++++++++++++++ dnstest.ipnr.txt | 89 +++++++++++++++++++++++++++++++++++++++++++++ dnstest.ipv4.txt | 63 ++++++++++++++++++++++++++++++++ dnstest.ipv6.txt | 35 ++++++++++++++++++ 4 files changed, 237 insertions(+) create mode 100644 dnstest.domains.txt create mode 100644 dnstest.ipnr.txt create mode 100644 dnstest.ipv4.txt create mode 100644 dnstest.ipv6.txt diff --git a/dnstest.domains.txt b/dnstest.domains.txt new file mode 100644 index 0000000..c34b278 --- /dev/null +++ b/dnstest.domains.txt @@ -0,0 +1,50 @@ +# 13 TESTS OR LESS SHOULD FIT WITHIN 80 CHARACTER TERMINAL DISPLAY + www.google.com + www.youtube.com + www.facebook.com + www.amazon.com + www.reddit.com + www.apple.com + www.yahoo.com + www.wikipedia.org + www.twitter.com + www.paypal.com + docker.io + github.com + gmail.com + +# OTHER TOP/POPULAR WEBSITES TO TEST AGAINST +# www.bing.com +# www.fandom.com +# www.microsoftonline.com +# www.walmart.com +# www.duckduckgo.com +# www.weather.com +# www.indeed.com +# www.qccerttest.com +# www.quora.com +# www.ebay.com +# www.cnn.com +# www.espn.com +# www.etsy.com +# www.nytimes.com +# www.imdb.com +# www.usps.com +# www.office.com +# www.microsoft.com +# www.zillow.com +# www.live.com +# www.plex.tv + +# SOCIAL NETWORKING SITES +# www.instagram.com +# www.twitch.tv +# www.tiktok.com +# www.linkedin.com + +# PORN SITES +# www.pornhub.com +# www.xvideos.com +# www.xnxx.com +# www.spankbang.com +# www.xhamster.com diff --git a/dnstest.ipnr.txt b/dnstest.ipnr.txt new file mode 100644 index 0000000..c9b0a0f --- /dev/null +++ b/dnstest.ipnr.txt @@ -0,0 +1,89 @@ +# NON-RESPONSIVE IP4 DNS PROVIDERS + 37.235.1.174#FreeDNS/1 + 37.235.1.177#FreeDNS/2 + 81.218.119.11#GreenTeamDNS/1 + 209.88.198.133#GreenTeamDNS/2 + 185.121.177.177#OpenNIC/1 + 169.239.202.202#OpenNIC/2 + 208.76.50.50#SmartViper/1 + 208.76.51.51#SmartViper/2 + 91.239.100.100#UncensoredDNS/1 + 89.233.43.71#UncensoredDNS/2 + +# NON-RESPONSIVE IP4 ISP DNS PROVIDERS + 202.56.4.20#Airtel/1 + 202.56.4.21#Airtel/2 + 68.94.156.1#ATT/1 + 68.94.157.1#ATT/2 + 194.72.9.38#BT/1 + 194.72.9.39#BT/2 + 209.18.47.61#Charter/1 + 209.18.47.62#Charter/2 + 200.195.138.195#Claro/1 + 200.195.138.196#Claro/2 + 75.75.75.75#Comcast/1 + 75.75.76.76#Comcast/2 + 68.105.28.10#Cox/1 + 68.105.29.10#Cox/2 + 192.227.172.30#Frontier/1 + 192.227.172.31#Frontier/2 + 212.27.40.240#Iliad/1 + 212.27.40.241#Iliad/2 + 218.231.0.1#KDDI/1 + 218.231.0.2#KDDI/2 + 62.241.162.1#LibertyG/1 + 62.241.162.2#LibertyG/2 + 202.188.0.133#M1/1 + 202.188.0.134#M1/2 + 75.75.75.75#Mediacom/1 + 75.75.76.76#Mediacom/2 + 209.212.96.1#MTN/1 + 209.212.96.2#MTN/2 + 61.213.177.100#NTT/1 + 61.213.177.101#NTT/2 + 193.113.200.200#O2/1 + 193.113.200.201#O2/2 + 61.88.88.88#Optus/1 + 61.88.86.86#Optus/2 + 80.10.246.2#Orange/1 + 80.10.246.129#Orange/2 + 24.150.1.10#Rogers/1 + 24.150.1.11#Rogers/2 + 194.190.0.1#Rostelecom/1 + 194.190.0.2#Rostelecom/2 + 202.156.0.24#SingTel/1 + 202.156.0.25#SingTel/2 + 194.168.4.100#Sky/1 + 194.168.8.100#Sky/2 + 210.145.0.1#SoftBank/1 + 210.145.0.2#SoftBank/2 + 209.18.47.61#Spectrum/1 + 209.18.47.62#Spectrum/2 + 208.180.32.2#TDS/1 + 208.180.32.1#TDS/2 + 80.58.61.250#Telefonica/1 + 80.58.61.254#Telefonica/2 + 62.155.0.1#Telekom/1 + 62.155.0.2#Telekom/2 + 194.63.248.101#Telenor/1 + 194.63.248.102#Telenor/2 + 62.115.5.2#Telia/1 + 62.115.5.3#Telia/2 + 61.9.208.1#Telstra/1 + 61.9.208.2#Telstra/2 + 213.205.32.6#Tiscali/1 + 213.205.32.5#Tiscali/2 + 212.175.50.50#TurkTelekom/1 + 212.175.50.51#TurkTelekom/2 + 195.34.32.116#VimpelCom/1 + 195.34.32.118#VimpelCom/2 + 212.39.90.42#Vivacom/1 + 212.39.90.43#Vivacom/2 + 83.138.131.248#Vodafone/1 + 83.138.131.249#Vodafone/2 + 162.23.4.14#Windstream/1 + 162.23.4.10#Windstream/2 + 216.221.117.23#Xplornet/1 + 216.221.117.24#Xplornet/2 + 41.34.20.1#Zain/1 + 41.34.20.2#Zain/2 diff --git a/dnstest.ipv4.txt b/dnstest.ipv4.txt new file mode 100644 index 0000000..66f1155 --- /dev/null +++ b/dnstest.ipv4.txt @@ -0,0 +1,63 @@ +### WELL-KNOWN IP4 DNS PROVIDERS + 94.140.14.14#AdGuard/1 + 94.140.15.15#AdGuard/2 + 185.228.168.9#CleanBrowsing/1 + 185.228.169.9#CleanBrowsing/2 + 1.1.1.1#Cloudflare/1 + 1.0.0.1#Cloudflare/2 + 8.26.56.26#Comodo/1 + 8.20.247.20#Comodo/2 + 8.8.8.8#Google/1 + 8.8.4.4#Google/2 + 4.2.2.1#Level3/1 + 4.2.2.2#Level3/2 + 64.6.64.6#Neustar/1 + 64.6.65.6#Neustar/2 + 208.67.222.222#OpenDNS/1 + 208.67.220.220#OpenDNS/2 + 216.146.35.35#OracleDyn/1 + 216.146.36.36#OracleDyn/2 + 9.9.9.9#Quad9/1 + 149.112.112.112#Quad9/2 + +### OTHER IP4 DNS PROVIDERS +#114.114.114.114#114DNS/1 +#114.114.115.115#114DNS/2 +# 223.5.5.5#AliDNS/1 +# 223.6.6.6#AliDNS/2 +# 76.76.19.19#AlternateDNS/1 +# 76.223.122.150#AlternateDNS/2 +# 1.2.4.8#CNNICSDNS/1 +# 210.2.4.8#CNNICSDNS/2 +# 76.76.2.0#ControlD/1 +# 76.76.10.0#ControlD/2 +# 84.200.69.80#DNS.WATCH/1 +# 84.200.70.40#DNS.WATCH/2 +# 103.247.36.36#DNSFilter/1 +# 103.247.37.37#DNSFilter/2 +# 101.226.4.6#DNSpai/1 +# 218.30.118.6#DNSpai/2 +# 119.29.29.29#DNSPodDNS+/1 +# 119.28.28.28#DNSPodDNS+/2 +# 80.80.80.80#Freenom/1 +# 80.80.81.81#Freenom/2 +# 45.90.28.243#NextDNS/1 +# 45.90.30.243#NextDNS/2 +# 199.85.126.10#NortonCS/1 +# 199.85.127.10#NortonCS/2 +# 117.50.11.11#OneDNS/1 +# 117.50.22.22#OneDNS/2 +# 195.46.39.39#SafeDNS/1 +# 195.46.39.40#SafeDNS/2 +# 64.6.64.6#Verisign/1 +# 64.6.65.6#Verisign/2 +# 77.88.8.8#Yandex/1 +# 77.88.8.1#Yandex/2 + +### ISP DNS PROVIDERS +# 205.171.3.65#CenturyLink/1 +# 205.171.2.65#CenturyLink/2 +# 202.97.224.68#ChinaTCL-UNC/1 +# 202.97.224.69#ChinaTCL-UNC/2 +# 168.126.63.1#SKTelecom/1 +# 168.126.63.2#SKTelecom/2 diff --git a/dnstest.ipv6.txt b/dnstest.ipv6.txt new file mode 100644 index 0000000..b46acee --- /dev/null +++ b/dnstest.ipv6.txt @@ -0,0 +1,35 @@ +# WELL-KNOWN IP6 DNS PROVIDERS + 2a10:50c0::ad1:ff#AdGuard/1-v6 + 2a10:50c0::ad2:ff#AdGuard/2-v6 + 2a0d:2a00:1::2#CleanBrowsing/1-v6 + 2a0d:2a00:2::2#CleanBrowsing/2-v6 + 2606:4700:4700::1111#Cloudflare/1-v6 + 2606:4700:4700::1001#Cloudflare/2-v6 + 2001:1608:10:25::1c04:b12f#DNS.WATCH/1 + 2001:1608:10:25::9249:d69b#DNS.WATCH/2 + 2001:4860:4860::8888#Google/1-v6 + 2001:4860:4860::8844#Google/2-v6 + 2620:74:1b::1:1#Neustar/1-v6 + 2620:74:1c::2:2#Neustar/2-v6 + 2620:119:35::35#OpenDNS/1-v6 + 2620:119:53::53#OpenDNS/2-v6 + 2620:fe::fe#Quad9/1-v6 + 2620:fe::9#Quad9/2-v6 + +# OTHER IP6 DNS PROVIDERS + 2602:fcbc::ad#AlternateDNS/1-v6 + 2602:fcbc:2::ad#AlternateDNS/2-v6 + 2606:1a40::#ControlD/1-v6 + 2606:1a40:1::#ControlD/2-v6 + 2a07:a8c0::11:b227#NextDNS/1-v6 + 2a07:a8c1::11:b227#NextDNS/2-v6 + 2a05:dfc7:5::53#OpenNIC/1-v6 + 2a05:dfc7:5353::53#OpenNIC/2-v6 + 2001:67c:2778::3939#SafeDNS/1-v6 + 2001:67c:2778::3939#SafeDNS/2-v6 + 2001:67c:28a4::#UncensoredDNS/1-v6 + 2a01:3a0:53:53::#UncensoredDNS/2-v6 + 2620:74:1b::1:1#Verisign/1-v6 + 2620:74:1c::2:2#Verisign/2-v6 + 2a02:6b8::feed:0ff#Yandex/1-v6 + 2a02:6b8:0:1::feed:0ff#Yandex/2-v6 From b0d86e884696bccf10d789a9ba2103e8e4d54c61 Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 15:29:11 -0700 Subject: [PATCH 08/20] Significant changes * Externalized DNS and testing domains lists to separate text files * Changed various code for greater shellcheck compliance * Changed repeating code into functions * Changed query results breakdowns --- dnstest.sh | 437 ++++++++++++++++++++++------------------------------- 1 file changed, 184 insertions(+), 253 deletions(-) diff --git a/dnstest.sh b/dnstest.sh index ecd5921..8268dfb 100755 --- a/dnstest.sh +++ b/dnstest.sh @@ -1,206 +1,99 @@ #!/usr/bin/env bash -# shellcheck disable=SC2034,SC2207 +# shellcheck disable=SC2034 # shellcheck source=/dev/null # bash /volume1/homes/admin/scripts/bash/dnstest.sh +# PARSE COMMAND-LINE OPTIONS (FUTURE OPTIONS) +while getopts "::" opt; do + case ${opt} in + \?) + echo "Usage: $0" + exit 1 + ;; + esac +done +shift $((OPTIND - 1)) + # CHECK FOR DIG REQUIREMENT -if ! command -v dig &> /dev/null; then - echo - echo "* DIG (Domain Information Gopher) is required for DNS queries, but" - echo " is not found in the PATH. Please install it." - echo +if ! command -v dig &>/dev/null; then + printf "\n" + printf "* DIG (Domain Information Gopher) is required for DNS queries,\n" + printf " but is not found in the PATH. Please install it.\n" + printf "\n" if [ -e "/proc/sys/kernel/syno_hw_version" ]; then - echo " DIG can be installed as a part of the 'SynoCli Network Tools'" - echo " package. This can be installed via the DSM Package Center by" - echo " adding the 'SynoCommunity' Package Source site, located at:" - echo - echo " https://packages.synocommunity.com/" + printf " DIG can be installed as a part of the 'SynoCli Network Tools'\n" + printf " package. This can be installed via the DSM Package Center by\n" + printf " adding the 'SynoCommunity' Package Source site, located at:\n" + printf "\n" + printf " https://packages.synocommunity.com/\n" else - echo " DIG can typically be installed as a part of the 'dnsutils'" - echo " or 'bind-utils' packages. These can be installed via your" - echo " package management system." + printf " DIG can typically be installed as a part of the 'dnsutils' or\n" + printf " 'bind-utils' packages. These can be installed via your\n" + printf " package management system.\n" fi - echo - echo Exiting... - echo -exit 1 + printf "\n" + printf "Exiting...\n" + printf "\n" + exit 1 fi # SCRAPE SCRIPT PATH INFO -SrceFllPth=$(readlink -f "${BASH_SOURCE[0]}") -SrceFolder=$(dirname "$SrceFllPth") -SrceFileNm=${SrceFllPth##*/} +SrceFllPth=$(readlink -f "${BASH_SOURCE[0]}") # get full path of running script +SrceFolder=$(dirname "$SrceFllPth") # extract directory path from full path +SrceFileNE=${SrceFllPth##*/} # extract filename and extension from full path +SrceFileNm=${SrceFileNE%.*} # extract only filename from filename and extension + +# RECURRING FUNCTIONS + +sanitize_array() { + local -n arr=$1 + shopt -s extglob + arr=("${arr[@]/#+([[:blank:]])/}") + arr=("${arr[@]/%+([[:blank:]])/}") +} + +query_dns() { + local server=$1 + local domain=$2 + local time + time=$(dig +tries=1 +timeout=1 @"$server" "$domain" | awk '/Query time:/ { print $4 }') + [[ -z "$time" ]] && time=1000 + [[ "$time" -eq 0 ]] && time=1 + echo "$time" +} # BUILD LIST OF NAMESERVERS USED BY THIS HOST -NAMESERVERS=($(grep ^nameserver /etc/resolv.conf | awk 'BEGIN{i=0}{i++;}{print $2 "#" $1 "/" i}')) +mapfile -t NAMESERVERS < <(awk '/^nameserver/ {print $2 "#" $1 "/" NR}' /etc/resolv.conf) # CHECK IF LOCALHOST IS RUNNING DNS ON THE DEFAULT PORT if LOCALTEST=$(netstat -tulpnW | grep "\:53\b" | grep "tcp\b" | grep "LISTEN"); then -# if [ "$?" -eq "0" ]; then - LOCALDNS=$(echo "$LOCALTEST" | awk -F '/' 'NR==1{ print $2 }') - LOCALHOST=127.0.0.1#"$LOCALDNS" - NAMESERVERS=("${LOCALHOST}" "${NAMESERVERS[@]}") + LOCALDNS=$(echo "$LOCALTEST" | awk -F '/' '{ gsub(/[ \t]+$/, "", $2); print $2 }' | head -n 1) + LOCALDNS="${LOCALDNS:0:14}" + LOCALHOST=("127.0.0.1#${LOCALDNS}/I" "127.0.0.1#${LOCALDNS}/C") + NAMESERVERS=("${LOCALHOST[@]}" "${NAMESERVERS[@]}") fi + # SANITIZE NAMESERVERS ARRAY -shopt -s extglob # turn on extended glob -NAMESERVERS=("${NAMESERVERS[@]/#+([[:blank:]])/}") # remove leading space/tab from each element -NAMESERVERS=("${NAMESERVERS[@]/%+([[:blank:]])/}") # remove trailing space/tab from each element - -# BUILD LIST OF IPV4 DNS PROVIDERS -PROVIDERSV4=" -# NOTABLE IP4 DNS PROVIDERS - 94.140.14.14#AdGuard/1 - 94.140.15.15#AdGuard/2 - 185.228.168.9#CleanBrowsing/1 - 185.228.169.9#CleanBrowsing/2 - 1.1.1.1#Cloudflare/1 - 1.0.0.1#Cloudflare/2 - 8.26.56.26#Comodo/1 - 8.20.247.20#Comodo/2 - 84.200.69.80#DNS.Watch/1 - 84.200.70.40#DNS.Watch/2 - 8.8.8.8#Google/1 - 8.8.4.4#Google/2 - 4.2.2.1#Level3/1 - 4.2.2.2#Level3/2 - 64.6.64.6#Neustar/1 - 64.6.65.6#Neustar/2 - 208.67.222.222#OpenDNS/1 - 208.67.220.220#OpenDNS/2 - 216.146.35.35#OracleDyn/1 - 216.146.36.36#OracleDyn/2 - 9.9.9.9#Quad9/1 - 149.112.112.112#Quad9/2 - -# OTHER IP4 DNS PROVIDERS - 76.76.19.19#AlternateDNS/1 - 76.223.122.150#AlternateDNS/2 - 76.76.2.0#ControlD/1 - 76.76.10.0#ControlD/2 - 103.247.36.36#DNSFilter/1 - 103.247.37.37#DNSFilter/2 - 80.80.80.80#Freenom/1 - 80.80.81.81#Freenom/2 - 45.90.28.243#NextDNS/1 - 45.90.30.243#NextDNS/2 - 199.85.126.10#NortonCS/1 - 199.85.127.10#NortonCS/2 - 195.46.39.39#SafeDNS/1 - 195.46.39.40#SafeDNS/2 - 91.239.100.100#UncensoredDNS/1 - 89.233.43.71#UncensoredDNS/2 - 64.6.64.6#Verisign/1 - 64.6.65.6#Verisign/2 - 77.88.8.8#Yandex/1 - 77.88.8.1#Yandex/2 -" -# SORT PROVIDERSV4 ARRAY -IFS=$'\n' PROVIDERSV4=($(sort -t "#" -k 2,2 <<<"${PROVIDERSV4[@]}")); unset IFS +sanitize_array NAMESERVERS + +# IMPORT LIST OF IPV4 DNS PROVIDERS +mapfile -t PROVIDERSV4 < <(sort -t "#" -k 2,2 "$SrceFolder/$SrceFileNm.ipv4.txt") # BUILD LIST OF IPV6 DNS PROVIDERS -PROVIDERSV6=" -# NOTABLE IP6 DNS PROVIDERS - 2a10:50c0::ad1:ff#AdGuard/1-v6 - 2a10:50c0::ad2:ff#AdGuard/2-v6 - 2a0d:2a00:1::2#CleanBrowsing/1-v6 - 2a0d:2a00:2::2#CleanBrowsing/2-v6 - 2606:4700:4700::1111#Cloudflare/1-v6 - 2606:4700:4700::1001#Cloudflare/2-v6 -2001:1608:10:25::1c04:b12f#DNS.Watch/1 -2001:1608:10:25::9249:d69b#DNS.Watch/2 - 2001:4860:4860::8888#Google/1-v6 - 2001:4860:4860::8844#Google/2-v6 - 2620:74:1b::1:1#Neustar/1 - 2620:74:1c::2:2#Neustar/2 - 2620:119:35::35#OpenDNS/1-v6 - 2620:119:53::53#OpenDNS/2-v6 - 2620:fe::fe#Quad9/1-v6 - 2620:fe::9#Quad9/2-v6 - -# OTHER IP6 DNS PROVIDERS - 2602:fcbc::ad#AlternateDNS/1-v6 - 2602:fcbc:2::ad#AlternateDNS/2-v6 - 2606:1a40::#ControlD/1-v6 - 2606:1a40:1::#ControlD/2-v6 - 2a07:a8c0::11:b227#NextDNS/1-v6 - 2a07:a8c1::11:b227#NextDNS/2-v6 - 2001:67c:2778::3939#SafeDNS/1-v6 - 2001:67c:2778::3939#SafeDNS/2-v6 - 2001:67c:28a4::#UncensoredDNS/1 - 2a01:3a0:53:53::#UncensoredDNS/2 - 2a02:6b8::feed:0ff#Yandex/1-v6 - 2a02:6b8:0:1::feed:0ff#Yandex/2-v6 -" -# SORT PROVIDERSV6 ARRAY -IFS=$'\n' PROVIDERSV6=($(sort -t "#" -k 2,2 <<<"${PROVIDERSV6[@]}")); unset IFS +mapfile -t PROVIDERSV6 < <(sort -t "#" -k 2,2 "$SrceFolder/$SrceFileNm.ipv6.txt") # BUILD LIST OF DOMAINS TO TEST AGAINST -DOMAINS2TEST=" -# 13 TESTS OR LESS SHOULD FIT WITHIN 80 CHARACTER TERMINAL DISPLAY - www.google.com - www.youtube.com - www.facebook.com - www.amazon.com - www.reddit.com - www.apple.com - www.yahoo.com - www.wikipedia.org - www.twitter.com - www.paypal.com - docker.io - github.com - gmail.com - -# OTHER TOP/POPULAR WEBSITES TO TEST AGAINST -# www.bing.com -# www.fandom.com -# www.microsoftonline.com -# www.walmart.com -# www.duckduckgo.com -# www.weather.com -# www.indeed.com -# www.qccerttest.com -# www.quora.com -# www.ebay.com -# www.cnn.com -# www.espn.com -# www.etsy.com -# www.nytimes.com -# www.imdb.com -# www.usps.com -# www.office.com -# www.microsoft.com -# www.zillow.com -# www.live.com -# www.plex.tv - -# SOCIAL NETWORKING SITES -# www.instagram.com -# www.twitch.tv -# www.tiktok.com -# www.linkedin.com - -# PORN SITES -# www.pornhub.com -# www.xvideos.com -# www.xnxx.com -# www.spankbang.com -# www.xhamster.com -" -# SORT DOMAINS2TEST ARRAY -IFS=$'\n' DOMAINS2TEST=($(sort -u <<<"${DOMAINS2TEST[@]}")); unset IFS +mapfile -t DOMAINS2TEST < <(sort -u "$SrceFolder/$SrceFileNm.domains.txt") # SANITIZE DOMAINS2TEST ARRAY -shopt -s extglob # turn on extended glob -DOMAINS2TEST=("${DOMAINS2TEST[@]/#+([[:blank:]])/}") # remove leading space/tab from each element -DOMAINS2TEST=("${DOMAINS2TEST[@]/%+([[:blank:]])/}") # remove trailing space/tab from each element +sanitize_array DOMAINS2TEST if [ "$1" = "ipv6" ]; then PROVIDERSTOTEST=("${PROVIDERSV6[@]}") elif [ "$1" = "ipv4" ]; then PROVIDERSTOTEST=("${PROVIDERSV4[@]}") elif [ "$1" = "all" ]; then - PROVIDERSTOTEST=("${PROVIDERSV4[@]}" "${PROVIDERSV6[@]}") + PROVIDERSTOTEST=("${PROVIDERSV4[@]}" "${PROVIDERSV6[@]}") else PROVIDERSTOTEST=("${PROVIDERSV4[@]}") fi @@ -211,127 +104,165 @@ elif [ "$1" = "-host" ]; then else PROVIDERSTOTEST=("${NAMESERVERS[@]}" "${PROVIDERSTOTEST[@]}") fi + # SANITIZE NAMESERVERS ARRAY -shopt -s extglob # turn on extended glob -PROVIDERSTOTEST=("${PROVIDERSTOTEST[@]/#+([[:blank:]])/}") # remove leading space/tab from each element -PROVIDERSTOTEST=("${PROVIDERSTOTEST[@]/%+([[:blank:]])/}") # remove trailing space/tab from each element +sanitize_array PROVIDERSTOTEST # DETERMINE NAMESERVERS NAME LENGTH ($nsl) for item in "${PROVIDERSTOTEST[@]}"; do -if [[ -n "$item" ]] && [[ ! $item =~ ^#.* ]]; then - pname=${item##*#} - plength[${#pname}]=${item##*#} # use word length as index -fi + if [[ -n "$item" ]] && [[ ! $item =~ ^#.* ]]; then + pname=${item##*#} + plength[${#pname}]=${item##*#} # use word length as index + fi done -longest=("${plength[@]: -1}") # select last array element +longest=("${plength[@]: -1}") # select last array element length=$((${#longest})) -nsl="%-$((${#longest} + 1))s" +nsl="%-$((${#longest} + 2))s" + +printf '\n\n%s\n\n' "TESTING DOMAINS ($SrceFileNE.domains)" +printf '%8s %s\n' "Test#" "Domain Name" +printf '%8s %s\n' "------" "---------------" -echo -echo TESTING DOMAINS: -echo -echo Test Domain Name -echo ---- --------------- for d in "${DOMAINS2TEST[@]}"; do -if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then - totaldomains=$((totaldomains + 1)) - printf "%3s: %s\n" "t$totaldomains" "$d" -fi + if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then + totaldomains=$((totaldomains + 1)) + printf '%8s %s\n' "t$totaldomains" "$d" + fi done unset totaldomains -echo -echo ALPHABETICAL TESTING: -echo +printf '\n\n%s\n\n' "LOCAL THEN ALPHABETICAL BY SERVER ($SrceFileNE.log)" # REDIRECT STDOUT TO TEE IN ORDER TO DUPLICATE THE OUTPUT TO THE TERMINAL AS WELL AS A .LOG FILE exec > >(tee "$SrceFllPth.log") -# totaldomains=0 -eval printf '$nsl' "Provider" +eval printf '$nsl' "Server" for d in "${DOMAINS2TEST[@]}"; do -if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then - totaldomains=$((totaldomains + 1)) - printf "%-4s" "t$totaldomains" -fi + if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then + totaldomains=$((totaldomains + 1)) + printf "%-4s" "t$totaldomains" + fi done printf "%9s\n" "Median ms" -eval printf -- '-%.0s' "{1..$length}" +eval printf -- '-%.0s' "{1..$((length + 1))}" + printf ' %.0s' "" for d in "${DOMAINS2TEST[@]}"; do -if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then - printf "%-4s" "---" -fi + if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then + printf "%-4s" "---" + fi done printf "%-4s\n" "---------" for p in "${PROVIDERSTOTEST[@]}"; do -if [[ -n "$p" ]] && [[ ! $p =~ ^#.* ]]; then - + if [[ -n "$p" ]] && [[ ! $p =~ ^#.* ]]; then pip=${p%%#*} pname=${p##*#} ftime=0 xtime=0 - eval printf '$nsl' "$pname" for d in "${DOMAINS2TEST[@]}"; do - if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then - - ttime=$(dig +tries=1 +timeout=1 @"$pip" "$d" | grep "Query time:" | awk '{ print $4 }') - - - - # NSLOOKUP INSTEAD OF DIG - # TEST=$((time (nslookup -timeout=1 -retry=0 www.microsoft.com 89.233.43.71)) 2>&1) - # echo "$TEST" | grep "connection timed out" - # echo "$TEST" | grep "real" - - - - if [ -z "$ttime" ]; then - #let's have time out be 1s = 1000ms - ttime=1000 - elif [ "$ttime" = "0" ]; then - ttime=1 - fi - - if [ "$ttime" -ge "1000" ]; then - printf "%-4s" "*" - xtime=$((xtime+1)) - else - printf "%-4s" "$ttime" + if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then + ttime=$(dig +tries=1 +timeout=1 @"$pip" "$d" | grep "Query time:" | awk '{ print $4 }') + if [ -z "$ttime" ]; then + ttime=1000 # Default timeout of 1000ms (1 second) + elif [ "$ttime" = "0" ]; then + ttime=1 + fi + if [ "$ttime" -ge "1000" ]; then + printf "%-4s" "*" + xtime=$((xtime + 1)) + else + printf "%-4s" "$ttime" + fi + ftime=$((ftime + ttime)) fi - - ftime=$((ftime + ttime)) - - fi done avg=$(awk -v a="$ftime" -v b="$totaldomains" 'BEGIN { printf "%.2f", a/b }' 999)}'; then + printf "%3s %5s\n" "NR" "$xtime-to" else printf "%9s\n" "$avg ms" fi - # sleep 30 + unset xtime + else + printf "%9s\n" "$avg ms" + fi fi done # CLOSE AND NORMALIZE THE LOGGING REDIRECTIONS -exec > /dev/tty 2>&1 +exec >/dev/tty 2>&1 -# SORT THE LOGGED OUTPUT BY FASTEST MEDIAN RESPONSE TIME -read -r third_line < <(head -n 3 "$SrceFllPth".log | tail -n 1) -num_fields=$(echo "$third_line" | awk '{print NF}') -sort -k "$((num_fields - 1))" -k "$num_fields" -n "$SrceFllPth".log -o "$SrceFllPth".sorted.log -(tail -n +3 "$SrceFllPth".log | sort -k "$((num_fields - 1))" -k "$num_fields" -n) \ - | cat <(head -n 2 "$SrceFllPth".log) - > "$SrceFllPth".sorted.log +# SUMMARY REPORTS +header_row=$(head -n 2 "$SrceFllPth.log") # Get the reusable results header row -echo -echo RESULTS SORTED BY MEDIAN RESPONSE TIME \("$SrceFileNm.sorted.log"\): +# SORT LOGGED OUTPUT BY FASTEST MEDIAN RESPONSE TIME +read -r third_line < <(head -n 3 "$SrceFllPth.log" | tail -n 1) +num_fields=$(echo "$third_line" | awk '{print NF}') +tail -n +3 "$SrceFllPth.log" | sort -k "$((num_fields - 1))" -k "$num_fields" -n -o "$SrceFllPth.sorted.log" +{ # Store the data how we want it presented + printf '%s\n' "$header_row" # Print the summary header + grep -v "NR" "$SrceFllPth.sorted.log" # Print responding servers + grep "NR" "$SrceFllPth.sorted.log" # Print non-responsing servers +} >"$SrceFllPth".temp.log && mv "$SrceFllPth".temp.log "$SrceFllPth.sorted.log" + +printf '\n\n%s\n\n' "ALL SERVERS BY MEDIAN RESPONSE TIME ($SrceFileNE.sorted.log)" +cat "$SrceFllPth.sorted.log" echo -cat "$SrceFllPth".sorted.log -echo -# exit 0; +# DISPLAY ONLY TIMEOUT LOGGED OUTPUT IF PRESENT +timeouts=$(grep "\*" "$SrceFllPth.sorted.log") +if [[ -n "$timeouts" ]]; then # Check if the variable timeouts is non-empty before printing + printf '\n%s\n\n' "RESULTS WITH QUERY TIMEOUTS" + printf '%s\n' "$header_row" + printf '%s\n' "$timeouts" +fi + +printf '\n%s\n\n' "RESPONDING PROVIDERS BY AVERAGED MEDIAN RESPONSE TIMES" + +# AVERAGE VALUES CALCULATION FOR EACH SERVER SET +declare -A sums counts +declare -A sums +declare -A counts + +while IFS= read -r line; do # Loop through each line in the sorted log file + server_set=$(echo "$line" | awk '{ print $1 }' | sed 's#/.*##') # Extract the server set name (base name before the '/1', '/2', etc.) + second_to_last_num=$(echo "$line" | awk '{ print $(NF-1) }') # Extract the second-to-last number (this is the median response time) + if [[ -n "$second_to_last_num" ]]; then # If the extracted number is not empty, process it + sums[$server_set]=$(awk -v sum="${sums[$server_set]:-0}" -v num="$second_to_last_num" 'BEGIN { print sum + num }') # Convert to floating-point if necessary + if [[ "$second_to_last_num" != "NR" ]]; then + counts[$server_set]=$((counts[$server_set] + 1)) + fi + fi +done < "$SrceFllPth.sorted.log" + +sorted_sums=() # Declare an array to hold the sorted sums +for server_set in "${!sums[@]}"; do # Collect the averages and server sets + if [[ "${counts[$server_set]}" -gt 0 ]]; then + avg=$(awk -v sum="${sums[$server_set]}" -v count="${counts[$server_set]}" 'BEGIN { printf "%.2f", sum / count }') + if [[ "$avg" != "0.00" ]]; then # Check if avg is not equal to 0.00 before adding to sorted_sums + sorted_sums+=("$avg $server_set") # Store both avg and server_set into the sorted_sums array + fi + fi +done + +# Sort the array based on the first column (avg value) numerically +sorted_output=$(printf '%s\n' "${sorted_sums[@]}" | sort -n) + +# Print the sorted results header +eval printf '$nsl' "Provider" +printf "%9s %s\n" "Average" "Servers" +eval printf -- '-%.0s' "{1..$((length + 1))}" +printf ' %.0s' "" +printf "%-4s %5s\n" "---------" "-------" + +while read -r avg server_set; do + eval printf '$nsl' "$server_set" # Print the provider name (server_set) formatted with $nsl + printf "%9s " "$avg ms" # Print the avg ms value right after the provider name + printf "(%s)" "${counts[$server_set]}" # Print the count in parentheses (from ${counts[$server_set]}) + printf "\n" +done <<<"$sorted_output" + +printf "\n" From f0d7a15455d8693cd36f5f61795b351dff04709b Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 15:38:58 -0700 Subject: [PATCH 09/20] updated example log to reflect code changes --- README.md | 325 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 206 insertions(+), 119 deletions(-) diff --git a/README.md b/README.md index bb0c6d5..c770cf9 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,15 @@ Includes the redundant servers of notable DNS providers by default: * AdGuard * CleanBrowsing -* Cloudflare (1.1.1.1) +* Cloudflare (aka 1.1.1.1) * Comodo * DNS.Watch -* Google (8.8.8.8) -* Level3 (4.2.2.1) +* Google (aka 8.8.8.8) +* Level3 (aka 4.2.2.1) * Neustar -* OpenDNS (208.67.222.222) +* OpenDNS (aka 208.67.222.222) * OracleDyn -* Quad9 (9.9.9.9) +* Quad9 (aka 9.9.9.9) As well as the redundant servers of these other well-known providers: @@ -47,127 +47,214 @@ As well as the redundant servers of these other well-known providers: # Required -You need to install `dig`. `bc` is no longer a requirement. +* `dig` needs to be in the PATH. +* `bc` is no longer a requirement of this script since being forked. `awk` is used instead for greater wide-spread availability. # Utilization and example output: - # bash dnstest.sh + #bash dnstest.sh + + TESTING DOMAINS (dnstest.domains.txt) + + Test# Domain Name + ------ --------------- + t1 docker.io + t2 github.com + t3 gmail.com + t4 www.amazon.com + t5 www.apple.com + t6 www.facebook.com + t7 www.google.com + t8 www.paypal.com + t9 www.reddit.com + t10 www.twitter.com + t11 www.wikipedia.org + t12 www.yahoo.com + t13 www.youtube.com + + + LOCAL THEN ALPHABETICAL BY SERVER (dnstest.log) + + Server t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 Median ms + ---------------- --- --- --- --- --- --- --- --- --- --- --- --- --- --------- + pihole-FTL/I 32 21 24 30 44 67 17 19 18 20 52 19 19 29.38 ms + pihole-FTL/C 1 1 1 1 1 1 1 1 2 1 1 2 5 1.46 ms + nameserver/1 19 26 29 31 36 66 19 18 15 19 91 19 39 32.85 ms + nameserver/2 17 22 24 23 87 17 18 18 18 19 86 18 51 32.15 ms + 114DNS/1 19 18 19 17 20 19 19 19 18 23 18 16 19 18.77 ms + 114DNS/2 18 17 17 19 17 17 17 19 24 19 18 22 18 18.62 ms + AdGuard/1 18 19 18 18 19 17 18 19 19 18 19 20 18 18.46 ms + AdGuard/2 19 19 18 20 19 19 19 19 18 20 18 20 17 18.85 ms + AliDNS/1 182 185 181 187 185 183 189 180 193 184 180 187 184 184.62 ms + AliDNS/2 195 181 190 180 194 186 190 180 182 194 181 194 176 186.38 ms + AlternateDNS/1 * * * * * * * * * * * * * NR 13-to + AlternateDNS/2 * * * * * * * * * * * * * NR 13-to + CenturyLink/1 61 25 26 31 27 27 25 28 30 25 28 31 25 29.92 ms + CenturyLink/2 44 28 35 28 29 27 34 28 29 34 28 29 27 30.77 ms + ChinaTCL-UNC/1 * * * * * 182 * * * 181 * * 184 811.31 ms + ChinaTCL-UNC/2 * * * * * 191 * * * 188 * * 188 812.85 ms + CleanBrowsing/1 24 17 17 19 18 19 19 20 19 18 24 18 24 19.69 ms + CleanBrowsing/2 160 160 167 155 160 160 161 154 159 159 159 159 159 159.38 ms + Cloudflare/1 27 14 13 13 13 62 28 14 13 16 13 13 118 27.46 ms + Cloudflare/2 12 9 15 12 14 15 13 15 9 13 54 13 13 15.92 ms + CNNICSDNS/1 254 256 355 361 263 250 249 * 396 259 811 261 242 381.31 ms + CNNICSDNS/2 421 267 467 255 260 256 412 * 243 225 335 353 305 369.15 ms + Comodo/1 * * * * * * * * * * * * * NR 13-to + Comodo/2 * * * * * * * * * * * * * NR 13-to + ControlD/1 21 23 21 30 26 21 21 26 16 23 22 27 18 22.69 ms + ControlD/2 19 17 12 20 20 27 19 17 20 24 19 17 23 19.54 ms + DNSFilter/1 19 17 18 19 17 14 19 20 19 18 19 18 22 18.38 ms + DNSFilter/2 24 23 18 13 18 19 18 17 24 19 14 25 19 19.31 ms + DNSpai/1 159 207 312 * 171 151 159 166 164 151 159 174 149 240.15 ms + DNSpai/2 199 279 361 221 201 190 197 194 221 192 203 219 192 220.69 ms + DNSPodDNS+/1 445 427 433 414 400 506 412 381 383 375 449 378 406 416.08 ms + DNSPodDNS+/2 275 249 207 186 190 201 211 207 189 251 204 248 196 216.46 ms + DNS.WATCH/1 169 178 * 184 * * 180 166 * 164 * * * 618.54 ms + DNS.WATCH/2 166 158 177 153 168 156 156 166 156 156 153 154 156 159.62 ms + Freenom/1 93 70 112 26 27 25 25 170 101 154 202 26 26 81.31 ms + Freenom/2 23 26 25 23 25 27 26 27 33 26 28 27 27 26.38 ms + Google/1 18 21 32 31 18 19 17 18 16 18 28 21 18 21.15 ms + Google/2 19 19 19 28 17 19 19 18 16 13 52 19 19 21.31 ms + Level3/1 26 14 24 18 22 19 19 18 20 18 17 25 18 19.85 ms + Level3/2 19 18 19 19 24 21 20 24 21 18 24 18 13 19.85 ms + Neustar/1 37 29 45 31 31 27 41 42 30 44 34 31 35 35.15 ms + Neustar/2 93 30 25 20 26 27 20 19 12 12 22 17 18 26.23 ms + NextDNS/1 15 23 18 19 18 18 15 17 19 19 19 19 26 18.85 ms + NextDNS/2 25 18 16 26 21 18 19 18 14 20 18 18 17 19.08 ms + NortonCS/1 31 20 19 19 20 18 19 19 24 17 17 20 20 20.23 ms + NortonCS/2 29 40 31 33 28 31 31 32 32 30 32 30 31 31.54 ms + OneDNS/1 * * * * * 172 * * * 171 * * 172 808.85 ms + OneDNS/2 180 388 178 183 224 171 195 234 177 171 184 181 172 202.92 ms + OpenDNS/1 23 19 25 29 30 20 18 29 18 19 50 21 20 24.69 ms + OpenDNS/2 12 14 17 26 29 36 17 18 17 13 18 20 18 19.62 ms + OracleDyn/1 227 76 75 73 78 75 75 79 82 70 166 73 76 94.23 ms + OracleDyn/2 137 76 75 75 77 79 73 73 77 76 144 74 76 85.54 ms + Quad9/1 19 19 24 18 20 18 19 19 19 18 24 20 19 19.69 ms + Quad9/2 19 22 24 88 29 67 96 267 112 119 78 74 59 81.08 ms + SafeDNS/1 21 19 19 38 20 20 19 17 15 20 18 23 15 20.31 ms + SafeDNS/2 18 20 18 19 19 20 17 18 13 20 19 20 18 18.38 ms + SKTelecom/1 156 157 162 155 153 160 156 160 162 163 154 226 155 163.00 ms + SKTelecom/2 162 156 154 155 153 161 155 157 151 159 156 163 160 157.08 ms + Verisign/1 28 30 31 29 31 30 28 28 28 30 33 35 32 30.23 ms + Verisign/2 21 15 18 18 18 19 19 19 18 19 20 23 19 18.92 ms + Yandex/1 214 201 212 203 221 205 196 240 205 239 203 204 204 211.31 ms + Yandex/2 208 206 202 198 204 207 220 207 212 211 240 217 222 211.85 ms + - TESTING DOMAINS: + ALL SERVERS BY MEDIAN RESPONSE TIME (dnstest.sorted.log) - Test Domain Name - ---- --------------- - t1: docker.io - t2: github.com - t3: gmail.com - t4: www.amazon.com - t5: www.apple.com - t6: www.facebook.com - t7: www.google.com - t8: www.paypal.com - t9: www.reddit.com - t10: www.twitter.com - t11: www.wikipedia.org - t12: www.yahoo.com - t13: www.youtube.com + Server t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 Median ms + ---------------- --- --- --- --- --- --- --- --- --- --- --- --- --- --------- + pihole-FTL/C 1 1 1 1 1 1 1 1 2 1 1 2 5 1.46 ms + Cloudflare/2 12 9 15 12 14 15 13 15 9 13 54 13 13 15.92 ms + DNSFilter/1 19 17 18 19 17 14 19 20 19 18 19 18 22 18.38 ms + SafeDNS/2 18 20 18 19 19 20 17 18 13 20 19 20 18 18.38 ms + AdGuard/1 18 19 18 18 19 17 18 19 19 18 19 20 18 18.46 ms + 114DNS/2 18 17 17 19 17 17 17 19 24 19 18 22 18 18.62 ms + 114DNS/1 19 18 19 17 20 19 19 19 18 23 18 16 19 18.77 ms + AdGuard/2 19 19 18 20 19 19 19 19 18 20 18 20 17 18.85 ms + NextDNS/1 15 23 18 19 18 18 15 17 19 19 19 19 26 18.85 ms + Verisign/2 21 15 18 18 18 19 19 19 18 19 20 23 19 18.92 ms + NextDNS/2 25 18 16 26 21 18 19 18 14 20 18 18 17 19.08 ms + DNSFilter/2 24 23 18 13 18 19 18 17 24 19 14 25 19 19.31 ms + ControlD/2 19 17 12 20 20 27 19 17 20 24 19 17 23 19.54 ms + OpenDNS/2 12 14 17 26 29 36 17 18 17 13 18 20 18 19.62 ms + CleanBrowsing/1 24 17 17 19 18 19 19 20 19 18 24 18 24 19.69 ms + Quad9/1 19 19 24 18 20 18 19 19 19 18 24 20 19 19.69 ms + Level3/1 26 14 24 18 22 19 19 18 20 18 17 25 18 19.85 ms + Level3/2 19 18 19 19 24 21 20 24 21 18 24 18 13 19.85 ms + NortonCS/1 31 20 19 19 20 18 19 19 24 17 17 20 20 20.23 ms + SafeDNS/1 21 19 19 38 20 20 19 17 15 20 18 23 15 20.31 ms + Google/1 18 21 32 31 18 19 17 18 16 18 28 21 18 21.15 ms + Google/2 19 19 19 28 17 19 19 18 16 13 52 19 19 21.31 ms + ControlD/1 21 23 21 30 26 21 21 26 16 23 22 27 18 22.69 ms + OpenDNS/1 23 19 25 29 30 20 18 29 18 19 50 21 20 24.69 ms + Neustar/2 93 30 25 20 26 27 20 19 12 12 22 17 18 26.23 ms + Freenom/2 23 26 25 23 25 27 26 27 33 26 28 27 27 26.38 ms + Cloudflare/1 27 14 13 13 13 62 28 14 13 16 13 13 118 27.46 ms + pihole-FTL/I 32 21 24 30 44 67 17 19 18 20 52 19 19 29.38 ms + CenturyLink/1 61 25 26 31 27 27 25 28 30 25 28 31 25 29.92 ms + Verisign/1 28 30 31 29 31 30 28 28 28 30 33 35 32 30.23 ms + CenturyLink/2 44 28 35 28 29 27 34 28 29 34 28 29 27 30.77 ms + NortonCS/2 29 40 31 33 28 31 31 32 32 30 32 30 31 31.54 ms + nameserver/2 17 22 24 23 87 17 18 18 18 19 86 18 51 32.15 ms + nameserver/1 19 26 29 31 36 66 19 18 15 19 91 19 39 32.85 ms + Neustar/1 37 29 45 31 31 27 41 42 30 44 34 31 35 35.15 ms + Quad9/2 19 22 24 88 29 67 96 267 112 119 78 74 59 81.08 ms + Freenom/1 93 70 112 26 27 25 25 170 101 154 202 26 26 81.31 ms + OracleDyn/2 137 76 75 75 77 79 73 73 77 76 144 74 76 85.54 ms + OracleDyn/1 227 76 75 73 78 75 75 79 82 70 166 73 76 94.23 ms + SKTelecom/2 162 156 154 155 153 161 155 157 151 159 156 163 160 157.08 ms + CleanBrowsing/2 160 160 167 155 160 160 161 154 159 159 159 159 159 159.38 ms + DNS.WATCH/2 166 158 177 153 168 156 156 166 156 156 153 154 156 159.62 ms + SKTelecom/1 156 157 162 155 153 160 156 160 162 163 154 226 155 163.00 ms + AliDNS/1 182 185 181 187 185 183 189 180 193 184 180 187 184 184.62 ms + AliDNS/2 195 181 190 180 194 186 190 180 182 194 181 194 176 186.38 ms + OneDNS/2 180 388 178 183 224 171 195 234 177 171 184 181 172 202.92 ms + Yandex/1 214 201 212 203 221 205 196 240 205 239 203 204 204 211.31 ms + Yandex/2 208 206 202 198 204 207 220 207 212 211 240 217 222 211.85 ms + DNSPodDNS+/2 275 249 207 186 190 201 211 207 189 251 204 248 196 216.46 ms + DNSpai/2 199 279 361 221 201 190 197 194 221 192 203 219 192 220.69 ms + DNSpai/1 159 207 312 * 171 151 159 166 164 151 159 174 149 240.15 ms + CNNICSDNS/2 421 267 467 255 260 256 412 * 243 225 335 353 305 369.15 ms + CNNICSDNS/1 254 256 355 361 263 250 249 * 396 259 811 261 242 381.31 ms + DNSPodDNS+/1 445 427 433 414 400 506 412 381 383 375 449 378 406 416.08 ms + DNS.WATCH/1 169 178 * 184 * * 180 166 * 164 * * * 618.54 ms + OneDNS/1 * * * * * 172 * * * 171 * * 172 808.85 ms + ChinaTCL-UNC/1 * * * * * 182 * * * 181 * * 184 811.31 ms + ChinaTCL-UNC/2 * * * * * 191 * * * 188 * * 188 812.85 ms + AlternateDNS/1 * * * * * * * * * * * * * NR 13-to + AlternateDNS/2 * * * * * * * * * * * * * NR 13-to + Comodo/1 * * * * * * * * * * * * * NR 13-to + Comodo/2 * * * * * * * * * * * * * NR 13-to - ALPHABETICAL TESTING: - Provider t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 Median ms - --------------- --- --- --- --- --- --- --- --- --- --- --- --- --- --------- - pihole-FTL 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00 ms - nameserver/1 49 21 64 82 79 20 19 19 20 19 74 20 19 38.85 ms - nameserver/2 50 69 52 29 30 22 21 20 21 19 49 19 22 32.54 ms - AdGuard/1 106 56 84 56 55 57 55 56 58 58 202 56 58 73.62 ms - AdGuard/2 56 55 56 57 58 58 58 56 57 57 58 58 56 56.92 ms - AlternateDNS/1 76 76 75 76 76 76 76 75 78 74 77 75 76 75.85 ms - AlternateDNS/2 76 76 80 76 76 77 72 73 77 78 78 76 76 76.23 ms - CleanBrowsing/1 97 81 79 81 80 80 82 83 79 84 81 80 83 82.31 ms - CleanBrowsing/2 57 55 56 55 55 55 53 57 55 55 56 56 55 55.38 ms - Cloudflare/1 50 47 49 45 48 48 46 48 48 50 48 50 45 47.85 ms - Cloudflare/2 49 48 49 49 46 44 49 48 48 49 45 49 46 47.62 ms - Comodo/1 30 29 31 30 32 30 32 31 30 30 149 28 31 39.46 ms - Comodo/2 30 25 30 30 30 31 31 30 30 30 30 31 33 30.08 ms - ControlD/1 24 20 35 22 32 21 21 61 21 26 182 21 21 39.00 ms - ControlD/2 21 21 19 20 22 21 19 22 20 21 20 20 19 20.38 ms - DNSFilter/1 19 17 18 19 19 20 18 17 19 20 20 20 19 18.85 ms - DNSFilter/2 21 22 21 18 19 20 20 22 21 22 21 19 20 20.46 ms - DNS.Watch/1 162 167 164 162 163 176 162 166 165 167 183 175 165 167.46 ms - DNS.Watch/2 159 160 165 166 164 182 167 162 * 162 170 161 166 999 1-to - Freenom/1 399 194 360 264 286 193 196 556 * 205 620 258 195 999 1-to - Freenom/2 412 191 311 507 288 195 195 205 301 235 614 724 194 336.31 ms - Google/1 20 20 18 29 23 19 18 19 18 17 55 17 19 22.46 ms - Google/2 17 21 26 61 23 19 18 18 20 21 18 19 21 23.23 ms - Level3/1 21 18 18 18 20 17 18 18 17 19 18 20 20 18.62 ms - Level3/2 19 17 16 18 19 18 17 21 17 20 21 16 20 18.38 ms - Neustar/1 61 27 28 24 28 25 26 27 27 28 28 27 26 29.38 ms - Neustar/2 18 20 19 38 21 20 21 18 19 19 19 19 21 20.92 ms - NextDNS/1 20 18 19 21 19 20 19 21 18 21 20 20 19 19.62 ms - NextDNS/2 54 21 19 20 14 20 21 22 20 21 21 21 20 22.62 ms - NortonCS/1 33 20 19 19 21 20 20 20 19 18 21 19 19 20.62 ms - NortonCS/2 43 29 26 24 27 24 27 26 27 25 26 27 27 27.54 ms - OpenDNS/1 21 21 34 48 29 19 20 18 20 19 79 18 20 28.15 ms - OpenDNS/2 22 22 37 60 19 30 18 19 19 19 18 19 21 24.85 ms - OracleDyn/1 39 29 27 24 25 27 25 23 29 30 25 30 28 27.77 ms - OracleDyn/2 40 31 28 27 27 27 28 32 29 26 27 28 28 29.08 ms - Quad9/1 21 20 21 19 21 20 20 19 18 19 20 19 19 19.69 ms - Quad9/2 18 22 19 24 19 20 21 21 19 21 19 20 20 20.23 ms - SafeDNS/1 137 136 146 163 135 135 146 137 134 132 135 136 176 142.15 ms - SafeDNS/2 136 135 134 136 136 135 137 136 135 135 135 135 135 135.38 ms - UncensoredDNS/1 * * * * * * * * * * * * * 999 13-to - UncensoredDNS/2 * * * * * * * * * * * * * 999 13-to - Verisign/1 33 28 29 27 28 27 27 27 27 27 28 27 25 27.69 ms - Verisign/2 21 18 19 19 14 18 18 19 18 20 21 20 20 18.85 ms - Yandex/1 203 210 202 197 192 201 206 204 623 199 202 198 185 232.46 ms - Yandex/2 194 187 189 190 195 207 188 214 209 186 206 202 187 196.46 ms + RESULTS WITH QUERY TIMEOUTS - RESULTS SORTED BY MEDIAN RESPONSE TIME (dnstest.sh.sorted.log): + Server t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 Median ms + ---------------- --- --- --- --- --- --- --- --- --- --- --- --- --- --------- + DNSpai/1 159 207 312 * 171 151 159 166 164 151 159 174 149 240.15 ms + CNNICSDNS/2 421 267 467 255 260 256 412 * 243 225 335 353 305 369.15 ms + CNNICSDNS/1 254 256 355 361 263 250 249 * 396 259 811 261 242 381.31 ms + DNS.WATCH/1 169 178 * 184 * * 180 166 * 164 * * * 618.54 ms + OneDNS/1 * * * * * 172 * * * 171 * * 172 808.85 ms + ChinaTCL-UNC/1 * * * * * 182 * * * 181 * * 184 811.31 ms + ChinaTCL-UNC/2 * * * * * 191 * * * 188 * * 188 812.85 ms + AlternateDNS/1 * * * * * * * * * * * * * NR 13-to + AlternateDNS/2 * * * * * * * * * * * * * NR 13-to + Comodo/1 * * * * * * * * * * * * * NR 13-to + Comodo/2 * * * * * * * * * * * * * NR 13-to - Provider t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 Median ms - --------------- --- --- --- --- --- --- --- --- --- --- --- --- --- --------- - pihole-FTL 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00 ms - Level3/2 19 17 16 18 19 18 17 21 17 20 21 16 20 18.38 ms - Level3/1 21 18 18 18 20 17 18 18 17 19 18 20 20 18.62 ms - DNSFilter/1 19 17 18 19 19 20 18 17 19 20 20 20 19 18.85 ms - Verisign/2 21 18 19 19 14 18 18 19 18 20 21 20 20 18.85 ms - NextDNS/1 20 18 19 21 19 20 19 21 18 21 20 20 19 19.62 ms - Quad9/1 21 20 21 19 21 20 20 19 18 19 20 19 19 19.69 ms - Quad9/2 18 22 19 24 19 20 21 21 19 21 19 20 20 20.23 ms - ControlD/2 21 21 19 20 22 21 19 22 20 21 20 20 19 20.38 ms - DNSFilter/2 21 22 21 18 19 20 20 22 21 22 21 19 20 20.46 ms - NortonCS/1 33 20 19 19 21 20 20 20 19 18 21 19 19 20.62 ms - Neustar/2 18 20 19 38 21 20 21 18 19 19 19 19 21 20.92 ms - Google/1 20 20 18 29 23 19 18 19 18 17 55 17 19 22.46 ms - NextDNS/2 54 21 19 20 14 20 21 22 20 21 21 21 20 22.62 ms - Google/2 17 21 26 61 23 19 18 18 20 21 18 19 21 23.23 ms - OpenDNS/2 22 22 37 60 19 30 18 19 19 19 18 19 21 24.85 ms - NortonCS/2 43 29 26 24 27 24 27 26 27 25 26 27 27 27.54 ms - Verisign/1 33 28 29 27 28 27 27 27 27 27 28 27 25 27.69 ms - OracleDyn/1 39 29 27 24 25 27 25 23 29 30 25 30 28 27.77 ms - OpenDNS/1 21 21 34 48 29 19 20 18 20 19 79 18 20 28.15 ms - OracleDyn/2 40 31 28 27 27 27 28 32 29 26 27 28 28 29.08 ms - Neustar/1 61 27 28 24 28 25 26 27 27 28 28 27 26 29.38 ms - Comodo/2 30 25 30 30 30 31 31 30 30 30 30 31 33 30.08 ms - nameserver/2 50 69 52 29 30 22 21 20 21 19 49 19 22 32.54 ms - nameserver/1 49 21 64 82 79 20 19 19 20 19 74 20 19 38.85 ms - ControlD/1 24 20 35 22 32 21 21 61 21 26 182 21 21 39.00 ms - Comodo/1 30 29 31 30 32 30 32 31 30 30 149 28 31 39.46 ms - Cloudflare/2 49 48 49 49 46 44 49 48 48 49 45 49 46 47.62 ms - Cloudflare/1 50 47 49 45 48 48 46 48 48 50 48 50 45 47.85 ms - CleanBrowsing/2 57 55 56 55 55 55 53 57 55 55 56 56 55 55.38 ms - AdGuard/2 56 55 56 57 58 58 58 56 57 57 58 58 56 56.92 ms - AdGuard/1 106 56 84 56 55 57 55 56 58 58 202 56 58 73.62 ms - AlternateDNS/1 76 76 75 76 76 76 76 75 78 74 77 75 76 75.85 ms - AlternateDNS/2 76 76 80 76 76 77 72 73 77 78 78 76 76 76.23 ms - CleanBrowsing/1 97 81 79 81 80 80 82 83 79 84 81 80 83 82.31 ms - SafeDNS/2 136 135 134 136 136 135 137 136 135 135 135 135 135 135.38 ms - SafeDNS/1 137 136 146 163 135 135 146 137 134 132 135 136 176 142.15 ms - DNS.Watch/1 162 167 164 162 163 176 162 166 165 167 183 175 165 167.46 ms - Yandex/2 194 187 189 190 195 207 188 214 209 186 206 202 187 196.46 ms - Yandex/1 203 210 202 197 192 201 206 204 623 199 202 198 185 232.46 ms - Freenom/2 412 191 311 507 288 195 195 205 301 235 614 724 194 336.31 ms - DNS.Watch/2 159 160 165 166 164 182 167 162 * 162 170 161 166 999 1-to - Freenom/1 399 194 360 264 286 193 196 556 * 205 620 258 195 999 1-to - UncensoredDNS/1 * * * * * * * * * * * * * 999 13-to - UncensoredDNS/2 * * * * * * * * * * * * * 999 13-to + RESPONDING PROVIDERS BY AVERAGED MEDIAN RESPONSE TIMES + Provider Average Servers + ---------------- --------- ------- + pihole-FTL 15.42 ms (2) + AdGuard 18.66 ms (2) + 114DNS 18.70 ms (2) + DNSFilter 18.84 ms (2) + NextDNS 18.96 ms (2) + SafeDNS 19.34 ms (2) + Level3 19.85 ms (2) + ControlD 21.11 ms (2) + Google 21.23 ms (2) + Cloudflare 21.69 ms (2) + OpenDNS 22.16 ms (2) + Verisign 24.57 ms (2) + NortonCS 25.89 ms (2) + CenturyLink 30.34 ms (2) + Neustar 30.69 ms (2) + nameserver 32.50 ms (2) + Quad9 50.38 ms (2) + Freenom 53.84 ms (2) + CleanBrowsing 89.53 ms (2) + OracleDyn 89.89 ms (2) + SKTelecom 160.04 ms (2) + AliDNS 185.50 ms (2) + Yandex 211.58 ms (2) + DNSpai 230.42 ms (2) + DNSPodDNS+ 316.27 ms (2) + CNNICSDNS 375.23 ms (2) + DNS.WATCH 389.08 ms (2) + OneDNS 505.88 ms (2) + ChinaTCL-UNC 812.08 ms (2) From ab4ef16d00e856316a115d4ee2e6d3bf6366b7a8 Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 16:44:51 -0700 Subject: [PATCH 10/20] added additional clarity --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c770cf9..bde9b2f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Shell script to test the performance of the most popular DNS resolvers from your location. -Includes the redundant servers of notable DNS providers by default: +The accompanying ipv4 and ipv6 text file contain the redundant servers of notable DNS providers by default, including: * AdGuard * CleanBrowsing @@ -16,7 +16,7 @@ Includes the redundant servers of notable DNS providers by default: * OracleDyn * Quad9 (aka 9.9.9.9) -As well as the redundant servers of these other well-known providers: +...as well as the redundant servers of these other well-known providers: * AlternateDNS * ControlD @@ -29,7 +29,7 @@ As well as the redundant servers of these other well-known providers: * Verisign * Yandex -13 default domain names are tested, with many others available as toggleable in the code: +13 default domain names are tested, with many others available as toggleable in the code, or simply add your own: * docker.io * github.com @@ -45,15 +45,22 @@ As well as the redundant servers of these other well-known providers: * www.yahoo.com * www.youtube.com -# Required +# Requirements -* `dig` needs to be in the PATH. -* `bc` is no longer a requirement of this script since being forked. `awk` is used instead for greater wide-spread availability. +* `dig` needs to be in the PATH. If you don't have it, the script will provide instructions for where to get it. +* `bc` is no longer a requirement of this script since being forked. `awk` is used instead for greater wide-spread availability - particularly for Synology. # Utilization and example output: - #bash dnstest.sh + # bash dnsreload.sh && bash dnstest.sh + CHECKING FOR LOCAL DNS SERVER AND FLUSHING CACHE + + Local DNS: tcp/53 pihole-FTL (pid:31093) + Type: docker (pihole) + Action: Reloading Pi-hole DNS (pihole-FTL) + + TESTING DOMAINS (dnstest.domains.txt) Test# Domain Name From a9fc7b565c0bef8fc32d6d46b5a377eeb099d82d Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 16:46:03 -0700 Subject: [PATCH 11/20] fixed spacing --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bde9b2f..50c02a0 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,7 @@ The accompanying ipv4 and ipv6 text file contain the redundant servers of notabl AlternateDNS/2 * * * * * * * * * * * * * NR 13-to Comodo/1 * * * * * * * * * * * * * NR 13-to Comodo/2 * * * * * * * * * * * * * NR 13-to + RESPONDING PROVIDERS BY AVERAGED MEDIAN RESPONSE TIMES From 9c39f712d19474abd85c5023634ee0dbc66275bc Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 16:48:06 -0700 Subject: [PATCH 12/20] fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50c02a0..bd070f9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Shell script to test the performance of the most popular DNS resolvers from your location. -The accompanying ipv4 and ipv6 text file contain the redundant servers of notable DNS providers by default, including: +The accompanying ipv4 and ipv6 text files contain the redundant servers of notable DNS providers by default, including: * AdGuard * CleanBrowsing From e812f3781b8bb09eb1534d07bd51a13525bda1f6 Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 16:48:53 -0700 Subject: [PATCH 13/20] Delete Dockerfile --- Dockerfile | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8d9e4c9..0000000 --- a/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM alpine:latest -RUN apk --no-cache add bash bc drill \ - && mkdir /app \ - && wget https://raw.githubusercontent.com/cleanbrowsing/dnsperftest/master/dnstest.sh -O /app/dnstest.sh \ - && chmod +x /app/dnstest.sh - -ENTRYPOINT ["/app/dnstest.sh"] From 6e493c6e3ef246849e8da4201b5373d81ddfec3a Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 16:50:07 -0700 Subject: [PATCH 14/20] Delete results.md --- results.md | 223 ----------------------------------------------------- 1 file changed, 223 deletions(-) delete mode 100644 results.md diff --git a/results.md b/results.md deleted file mode 100644 index dd5d7a4..0000000 --- a/results.md +++ /dev/null @@ -1,223 +0,0 @@ -# DNS Performance Results - -Results from tests done by our users. Feel free to add yours (including Country, City and ISP / Datacenter). - -## North America - * [USA, California, San Diego, Frontier Residential](#usa-san-diego-frontier) - * [USA, California, Fremont, Linode Datacenter](#usa-fremont-linode) - * [USA, California, San Francisco, Digital Ocean Datacenter](#usa-sanfrancisco-digitalocean) - * [USA, Texas, Dallas, Linode](#usa-dallas-linode) - * [Canada, NB, Fredericton, Bell Aliant](#canada-nb-fredericton-bell) - * [Mexico, NL, Monterrey, Axtel](#mexico-nl-monterrey-axtel) - -## Europe - * [France, Paris, OVH Datacenter](#france-paris-ovh) - * [Germany, Karlsruhe, Residential](#germany-karlsruhe) - -## South America - * [Argentina, Buenos Aires, Residential](#argentina-buenosaires) - * [Brazil, Sao Paulo, AWS Datacenter](#brazil-saopaulo-aws) - -## Africa - * [Tunisia, Ariana, El Ghazela, Orange Tunisie](#tn-elghazela-orange) - -## North America Results - - -**USA, California, San Diego, Frontier Residential** - -``` - test1 test2 test3 test4 test5 test6 test7 test8 test9 Average -#1 level3 6 ms 8 ms 6 ms 6 ms 13 ms 6 ms 5 ms 7 ms 6 ms 7.00 -#2 cloudflare 6 ms 7 ms 11 ms 7 ms 7 ms 8 ms 7 ms 7 ms 7 ms 7.40 -#3 neustar 7 ms 7 ms 7 ms 6 ms 6 ms 9 ms 6 ms 10 ms 21 ms 8.70 -#4 norton 23 ms 7 ms 6 ms 9 ms 8 ms 7 ms 7 ms 6 ms 23 ms 10.40 -#5 cleanbrowsing 22 ms 18 ms 16 ms 18 ms 18 ms 18 ms 17 ms 16 ms 16 ms 17.90 -#6 google 6 ms 34 ms 7 ms 7 ms 42 ms 31 ms 11 ms 31 ms 7 ms 21.40 -#7 opendns 35 ms 8 ms 7 ms 44 ms 21 ms 68 ms 8 ms 56 ms 6 ms 27.10 -#8 quad9 15 ms 38 ms 80 ms 22 ms 15 ms 20 ms 24 ms 57 ms 20 ms 31.50 -#9 freenom 21 ms 42 ms 19 ms 20 ms 111 ms 212 ms 20 ms 70 ms 19 ms 59.40 -#10 comodo 79 ms 81 ms 74 ms 74 ms 75 ms 77 ms 76 ms 77 ms 80 ms 76.70 -#11 yandex 188 ms 268 ms 195 ms 191 ms 190 ms 195 ms 191 ms 205 ms 189 ms 203.50 -#12 adguard 196 ms 255 ms 203 ms 281 ms 229 ms 255 ms 183 ms 220 ms 187 ms 219.50 -``` - - -**USA, California, Fremont, Linode Datacenter** -``` test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -#1 cloudflare 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -#2 norton 1 ms 1 ms 1 ms 2 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.10 -#3 neustar 1 ms 1 ms 1 ms 2 ms 1 ms 1 ms 1 ms 1 ms 1 ms 2 ms 1.20 -#4 level3 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 4 ms 2.20 -#5 cleanbrowsing 1 ms 10 ms 8 ms 9 ms 2 ms 1 ms 1 ms 9 ms 1 ms 9 ms 5.10 -#6 google 19 ms 1 ms 1 ms 19 ms 19 ms 79 ms 1 ms 21 ms 21 ms 1 ms 18.20 -#7 opendns 39 ms 2 ms 2 ms 39 ms 3 ms 76 ms 2 ms 2 ms 21 ms 12 ms 19.80 -#8 quad9 67 ms 68 ms 2 ms 67 ms 1 ms 27 ms 69 ms 1 ms 1 ms 153 ms 45.60 -#9 comodo 68 ms 67 ms 67 ms 67 ms 67 ms 67 ms 67 ms 66 ms 67 ms 67 ms 67.00 -#10 freenom 143 ms 57 ms 56 ms 56 ms 57 ms 144 ms 57 ms 57 ms 145 ms 57 ms 82.90 -#11 adguard 146 ms 143 ms 143 ms 1 ms 3 ms 144 ms 5 ms 1 ms 145 ms 146 ms 87.70 -#12 yandex 179 ms 173 ms 174 ms 174 ms 185 ms 199 ms 172 ms 173 ms 172 ms 231 ms 183.20 -``` - - -**USA, California, San Francisco, Digital Ocean Datacenter** -``` test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -#1 level3 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 2 ms 1 ms 1.10 -#2 norton 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2.00 -#3 neustar 2 ms 2 ms 2 ms 3 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2 ms 2.10 -#4 cloudflare 2 ms 2 ms 3 ms 3 ms 3 ms 2 ms 2 ms 2 ms 3 ms 2 ms 2.40 -#5 cleanbrowsing 4 ms 4 ms 4 ms 4 ms 4 ms 4 ms 4 ms 4 ms 4 ms 4 ms 4.00 -#6 adguard 2 ms 5 ms 2 ms 7 ms 2 ms 2 ms 6 ms 2 ms 9 ms 8 ms 4.50 -#7 google 1 ms 3 ms 3 ms 20 ms 20 ms 61 ms 6 ms 23 ms 21 ms 4 ms 16.20 -#8 quad9 2 ms 2 ms 59 ms 2 ms 1 ms 9 ms 2 ms 125 ms 2 ms 1 ms 20.50 -#9 opendns 1 ms 1 ms 2 ms 58 ms 3 ms 148 ms 1 ms 38 ms 1 ms 11 ms 26.40 -#10 freenom 28 ms 26 ms 28 ms 26 ms 24 ms 28 ms 28 ms 26 ms 28 ms 26 ms 26.80 -#11 comodo 79 ms 172 ms 84 ms 76 ms 79 ms 81 ms 83 ms 83 ms 76 ms 79 ms 89.20 -#12 yandex 178 ms 210 ms 198 ms 176 ms 185 ms 178 ms 179 ms 187 ms 180 ms 181 ms 185.20 -``` - - -**USA, Texas, Dallas, Linode Datacenter** -``` test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -#1 cleanbrowsing 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -#1 cloudflare 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -#1 level3 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -#4 norton 1 ms 1 ms 1 ms 2 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.10 -#5 neustar 1 ms 1 ms 1 ms 2 ms 1 ms 2 ms 2 ms 1 ms 1 ms 1 ms 1.30 -#6 opendns 1 ms 1 ms 1 ms 14 ms 1 ms 2 ms 1 ms 7 ms 7 ms 1 ms 3.60 -#7 google 8 ms 8 ms 1 ms 8 ms 9 ms 39 ms 1 ms 8 ms 10 ms 1 ms 9.30 -#8 quad9 1 ms 30 ms 30 ms 1 ms 1 ms 1 ms 1 ms 30 ms 30 ms 58 ms 18.30 -#9 comodo 38 ms 38 ms 38 ms 38 ms 38 ms 38 ms 38 ms 37 ms 37 ms 38 ms 37.80 -#10 adguard 114 ms 43 ms 42 ms 112 ms 119 ms 41 ms 115 ms 116 ms 116 ms 41 ms 85.90 -#11 freenom 115 ms 125 ms 114 ms 125 ms 151 ms 230 ms 125 ms 124 ms 114 ms 116 ms 133.90 -#12 yandex 140 ms 177 ms 141 ms 137 ms 147 ms 171 ms 139 ms 143 ms 140 ms 163 ms 149.80 -``` - - -**Canada, NB, Fredericton, Bell Aliant** -``` - test1 test2 test3 test4 test5 test6 test7 test8 test9 Average -#1 cloudflare 38 ms 38 ms 38 ms 37 ms 37 ms 37 ms 37 ms 37 ms 38 ms 37.40 -#2 cleanbrowsing 37 ms 37 ms 37 ms 37 ms 37 ms 37 ms 45 ms 38 ms 37 ms 37.90 -#3 neustar 37 ms 38 ms 38 ms 38 ms 38 ms 39 ms 37 ms 40 ms 38 ms 38.10 -#4 google 38 ms 37 ms 75 ms 37 ms 46 ms 38 ms 37 ms 40 ms 37 ms 42.20 -#5 comodo 38 ms 41 ms 100 ms 42 ms 38 ms 38 ms 40 ms 43 ms 39 ms 45.80 -#6 quad9 59 ms 62 ms 57 ms 58 ms 65 ms 67 ms 70 ms 71 ms 133 ms 84.80 -#7 norton 147 ms 280 ms 154 ms 38 ms 39 ms 38 ms 40 ms 37 ms 40 ms 85.10 -#8 adguard 119 ms 118 ms 128 ms 112 ms 118 ms 114 ms 119 ms 119 ms 116 ms 118.50 -#9 yandex 145 ms 147 ms 142 ms 144 ms 148 ms 174 ms 136 ms 141 ms 143 ms 146.10 -#10 opendns 172 ms 63 ms 245 ms 158 ms 146 ms 159 ms 279 ms 140 ms 163 ms 167.50 -``` - - - -**Mexico, NL, Monterrey, Axtel** -``` - test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -#1 cloudflare 6 ms 7 ms 7 ms 7 ms 9 ms 7 ms 6 ms 6 ms 6 ms 8 ms 6.90 -#2 level3 20 ms 19 ms 20 ms 20 ms 20 ms 19 ms 20 ms 20 ms 20 ms 19 ms 19.70 -#3 google 32 ms 32 ms 76 ms 64 ms 70 ms 31 ms 34 ms 64 ms 33 ms 34 ms 47.00 -#4 quad9 30 ms 30 ms 33 ms 29 ms 33 ms 32 ms 32 ms 28 ms 28 ms 270 ms 54.50 -#5 freenom 31 ms 31 ms 30 ms 31 ms 32 ms 31 ms 31 ms 31 ms 31 ms 31 ms 31.00 -#6 opendns 18 ms 18 ms 19 ms 27 ms 19 ms 20 ms 18 ms 24 ms 26 ms 19 ms 20.80 -#7 norton 214 ms 20 ms 20 ms 21 ms 20 ms 20 ms 19 ms 20 ms 20 ms 21 ms 39.50 -#8 cleanbrowsing 23 ms 22 ms 25 ms 21 ms 22 ms 311 ms 30 ms 23 ms 22 ms 32 ms 53.10 -#9 yandex 182 ms 178 ms 187 ms 180 ms 183 ms 185 ms 181 ms 182 ms 187 ms 203 ms 184.80 -#10 adguard 56 ms 71 ms 56 ms 57 ms 61 ms 57 ms 1000 ms 72 ms 61 ms 82 ms 157.30 -#11 neustar 20 ms 20 ms 19 ms 21 ms 21 ms 19 ms 19 ms 20 ms 20 ms 19 ms 19.80 -#12 comodo 22 ms 59 ms 19 ms 22 ms 23 ms 22 ms 20 ms 28 ms 21 ms 22 ms 25.80 -``` - -## Europe Results - -**France, Paris, OVH Datacenter** -``` - test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -#1 cloudflare 5 ms 17 ms 5 ms 5 ms 5 ms 5 ms 5 ms 5 ms 5 ms 5 ms 6.20 -#2 cleanbrowsing 7 ms 7 ms 7 ms 7 ms 7 ms 7 ms 7 ms 7 ms 7 ms 7 ms 7.00 -#3 freenom 7 ms 9 ms 7 ms 7 ms 7 ms 7 ms 7 ms 7 ms 7 ms 7 ms 7.20 -#4 level3 7 ms 8 ms 7 ms 7 ms 8 ms 8 ms 7 ms 7 ms 7 ms 7 ms 7.30 -#5 quad9 7 ms 8 ms 7 ms 7 ms 8 ms 7 ms 7 ms 7 ms 7 ms 8 ms 7.30 -#6 google 5 ms 5 ms 4 ms 19 ms 5 ms 16 ms 5 ms 12 ms 12 ms 10 ms 9.30 -#7 opendns 5 ms 20 ms 5 ms 5 ms 5 ms 5 ms 18 ms 17 ms 17 ms 5 ms 10.20 -#8 neustar 20 ms 22 ms 20 ms 21 ms 21 ms 21 ms 21 ms 21 ms 21 ms 21 ms 20.90 -#9 norton 21 ms 21 ms 21 ms 21 ms 21 ms 21 ms 22 ms 21 ms 21 ms 21 ms 21.10 -#10 yandex 39 ms 38 ms 39 ms 38 ms 47 ms 39 ms 36 ms 42 ms 35 ms 78 ms 43.10 -#11 comodo 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 10 ms 417 ms 50.70 -#12 adguard 55 ms 125 ms 54 ms 54 ms 66 ms 61 ms 58 ms 54 ms 54 ms 54 ms 63.50 -``` - - -**Germany, Karlsruhe, Residential** -``` - test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -127.0.0.1 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1 ms 1.00 -45.90.30.39 15 ms 11 ms 15 ms 15 ms 15 ms 19 ms 11 ms 15 ms 15 ms 15 ms 14.60 -84.200.69.80 15 ms 11 ms 15 ms 15 ms 11 ms 11 ms 15 ms 19 ms 23 ms 19 ms 15.40 -cloudflare 27 ms 15 ms 19 ms 11 ms 15 ms 19 ms 11 ms 11 ms 27 ms 15 ms 17.00 -level3 15 ms 11 ms 11 ms 15 ms 19 ms 11 ms 15 ms 19 ms 23 ms 15 ms 15.40 -google 19 ms 23 ms 19 ms 35 ms 23 ms 23 ms 19 ms 31 ms 23 ms 23 ms 23.80 -quad9 1000 ms 1000 ms 31 ms 1000 ms 23 ms 1000 ms 19 ms 1000 ms 1000 ms 1000 ms 707.30 -freenom 43 ms 1000 ms 1000 ms 1000 ms 671 ms 1000 ms 1000 ms 1000 ms 1000 ms 1000 ms 871.40 -opendns 23 ms 19 ms 19 ms 23 ms 15 ms 95 ms 11 ms 23 ms 23 ms 15 ms 26.60 -norton 15 ms 15 ms 11 ms 15 ms 19 ms 23 ms 27 ms 19 ms 19 ms 23 ms 18.60 -cleanbrowsing 15 ms 19 ms 15 ms 27 ms 19 ms 19 ms 19 ms 11 ms 27 ms 11 ms 18.20 -yandex 51 ms 51 ms 55 ms 43 ms 59 ms 55 ms 55 ms 55 ms 51 ms 71 ms 54.60 -adguard 135 ms 119 ms 119 ms 119 ms 115 ms 111 ms 115 ms 119 ms 115 ms 119 ms 118.60 -neustar 19 ms 27 ms 23 ms 31 ms 39 ms 19 ms 27 ms 23 ms 23 ms 23 ms 25.40 -comodo 11 ms 15 ms 15 ms 27 ms 15 ms 19 ms 15 ms 15 ms 19 ms 15 ms 16.60 -``` - -## South America - -**Argentina, Buenos Aires, Residential** -``` - test1 test2 test3 test4 test5 test6 test7 test8 test9 Average -#1 cloudflare 26 ms 25 ms 26 ms 24 ms 26 ms 25 ms 24 ms 24 ms 25 ms 25.00 -#2 google 25 ms 25 ms 25 ms 27 ms 81 ms 25 ms 24 ms 26 ms 24 ms 30.60 -#3 cleanbrowsing 32 ms 36 ms 34 ms 35 ms 33 ms 31 ms 33 ms 156 ms 33 ms 46.00 -#4 opendns 149 ms 32 ms 32 ms 269 ms 34 ms 232 ms 32 ms 152 ms 87 ms 105.30 -#5 neustar 160 ms 150 ms 164 ms 161 ms 159 ms 156 ms 159 ms 159 ms 156 ms 158.30 -#6 quad9 158 ms 160 ms 156 ms 158 ms 157 ms 158 ms 163 ms 159 ms 159 ms 158.80 -#7 norton 156 ms 152 ms 163 ms 156 ms 174 ms 158 ms 157 ms 163 ms 161 ms 160.30 -#8 comodo 169 ms 170 ms 171 ms 162 ms 166 ms 161 ms 169 ms 162 ms 165 ms 166.10 -#9 yandex 271 ms 283 ms 297 ms 288 ms 287 ms 302 ms 277 ms 295 ms 294 ms 289.00 -#10 adguard 291 ms 290 ms 290 ms 294 ms 285 ms 288 ms 287 ms 297 ms 284 ms 290.00 -``` - - -**Brazil, Sao Paulo, AWS Datacenter** -``` - test1 test2 test3 test4 test5 test6 test7 test8 test9 Average -#1 cleanbrowsing 3 ms 3 ms 4 ms 3 ms 4 ms 4 ms 3 ms 4 ms 4 ms 3.60 -#2 cloudflare 6 ms 5 ms 5 ms 5 ms 5 ms 29 ms 5 ms 5 ms 6 ms 10.20 -#3 google 58 ms 2 ms 1 ms 57 ms 105 ms 52 ms 2 ms 55 ms 49 ms 38.20 -#4 opendns 122 ms 4 ms 3 ms 180 ms 3 ms 122 ms 4 ms 4 ms 3 ms 44.90 -#5 neustar 112 ms 112 ms 112 ms 111 ms 112 ms 113 ms 113 ms 111 ms 114 ms 112.10 -#6 norton 118 ms 113 ms 111 ms 111 ms 113 ms 117 ms 113 ms 114 ms 113 ms 114.20 -#7 level3 122 ms 121 ms 120 ms 121 ms 122 ms 123 ms 123 ms 121 ms 122 ms 121.70 -#8 comodo 133 ms 128 ms 128 ms 129 ms 127 ms 128 ms 128 ms 128 ms 128 ms 129.00 -#9 freenom 161 ms 161 ms 168 ms 207 ms 172 ms 161 ms 162 ms 167 ms 169 ms 169.00 -#10 quad9 176 ms 176 ms 175 ms 175 ms 176 ms 175 ms 175 ms 175 ms 176 ms 175.40 -#11 yandex 240 ms 272 ms 243 ms 247 ms 242 ms 236 ms 237 ms 241 ms 236 ms 243.10 -#12 adguard 249 ms 245 ms 247 ms 250 ms 249 ms 244 ms 244 ms 252 ms 259 ms 248.70 -``` - -## Africa Results - -**Tunisia, Ariana, El Ghazela, Orange Tunisie** -``` - test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average -#1 opendns 75 ms 68 ms 51 ms 73 ms 60 ms 48 ms 50 ms 54 ms 83 ms 63 ms 62.50 -#2 cloudflare 66 ms 61 ms 73 ms 65 ms 60 ms 65 ms 64 ms 66 ms 75 ms 64 ms 65.90 -#3 google 63 ms 55 ms 54 ms 74 ms 87 ms 75 ms 54 ms 95 ms 66 ms 64 ms 68.70 -#4 level3 64 ms 59 ms 73 ms 74 ms 65 ms 85 ms 65 ms 73 ms 77 ms 60 ms 69.50 -#5 norton 69 ms 71 ms 78 ms 62 ms 69 ms 70 ms 75 ms 73 ms 68 ms 71 ms 70.60 -#6 neustar 86 ms 62 ms 71 ms 74 ms 70 ms 83 ms 66 ms 68 ms 70 ms 72 ms 72.20 -#7 quad9 89 ms 80 ms 92 ms 66 ms 67 ms 82 ms 63 ms 72 ms 88 ms 67 ms 76.60 -#8 adguard 89 ms 82 ms 64 ms 86 ms 85 ms 70 ms 84 ms 72 ms 76 ms 84 ms 79.20 -#9 cleanbrowsing 83 ms 70 ms 62 ms 61 ms 75 ms 198 ms 65 ms 72 ms 61 ms 71 ms 81.80 -#12 yandex 108 ms 148 ms 93 ms 108 ms 113 ms 101 ms 112 ms 92 ms 94 ms 131 ms 110.00 -#11 freenom 87 ms 124 ms 92 ms 111 ms 136 ms 250 ms 128 ms 338 ms 101 ms 177 ms 154.40 -#12 comodo 89 ms 5092 ms 93 ms 99 ms 96 ms 85 ms 10106 ms 80 ms 86 ms 5127 ms 2095.30 -``` From 6c6d94321bd7821db69520841a11595875c1d2fb Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 16:50:35 -0700 Subject: [PATCH 15/20] Delete LICENSE.txt --- LICENSE.txt | 688 ---------------------------------------------------- 1 file changed, 688 deletions(-) delete mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index d1338b2..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,688 +0,0 @@ -Copyright (C) 2018 - 2022 CleanBrowsing Inc. All rights reserved. - - dnsperftest is a free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License (version 3) as - published by the FSF - Free Software Foundation. - - dsperftest is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License Version 3 below for more details. - ------------------------------------------------------------------------------ - - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. From 07d095cd2105e4d1b1d54f8c0a42342e7f17b673 Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 16:52:51 -0700 Subject: [PATCH 16/20] clarification --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd070f9..d35e969 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The accompanying ipv4 and ipv6 text files contain the redundant servers of notab * Verisign * Yandex -13 default domain names are tested, with many others available as toggleable in the code, or simply add your own: +13 default domain names are tested, with many others available as toggleable in the accompanying text files, or simply add your own: * docker.io * github.com From 480ad7fcda628dd875798d914e8ce63ee992e3fc Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 17:02:26 -0700 Subject: [PATCH 17/20] optimizations * Further reduced subshell use * Fixed logging naming conventions * Removed last uses of echo --- dnstest.sh | 58 +++++++++++++++++++++++++----------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/dnstest.sh b/dnstest.sh index 8268dfb..bab525a 100755 --- a/dnstest.sh +++ b/dnstest.sh @@ -7,7 +7,7 @@ while getopts "::" opt; do case ${opt} in \?) - echo "Usage: $0" + printf "Usage: %s\n" "$0" exit 1 ;; esac @@ -59,7 +59,7 @@ query_dns() { time=$(dig +tries=1 +timeout=1 @"$server" "$domain" | awk '/Query time:/ { print $4 }') [[ -z "$time" ]] && time=1000 [[ "$time" -eq 0 ]] && time=1 - echo "$time" + printf "%s\n" "$time" } # BUILD LIST OF NAMESERVERS USED BY THIS HOST @@ -67,7 +67,7 @@ mapfile -t NAMESERVERS < <(awk '/^nameserver/ {print $2 "#" $1 "/" NR}' /etc/res # CHECK IF LOCALHOST IS RUNNING DNS ON THE DEFAULT PORT if LOCALTEST=$(netstat -tulpnW | grep "\:53\b" | grep "tcp\b" | grep "LISTEN"); then - LOCALDNS=$(echo "$LOCALTEST" | awk -F '/' '{ gsub(/[ \t]+$/, "", $2); print $2 }' | head -n 1) + LOCALDNS=$(awk -F '/' 'NR==1 { sub(/[ \t]+$/, "", $2); print $2; exit }' <<< "$LOCALTEST") LOCALDNS="${LOCALDNS:0:14}" LOCALHOST=("127.0.0.1#${LOCALDNS}/I" "127.0.0.1#${LOCALDNS}/C") NAMESERVERS=("${LOCALHOST[@]}" "${NAMESERVERS[@]}") @@ -119,22 +119,23 @@ longest=("${plength[@]: -1}") # select las length=$((${#longest})) nsl="%-$((${#longest} + 2))s" -printf '\n\n%s\n\n' "TESTING DOMAINS ($SrceFileNE.domains)" +printf '\n\n%s\n\n' "TESTING DOMAINS ($SrceFileNm.domains)" printf '%8s %s\n' "Test#" "Domain Name" printf '%8s %s\n' "------" "---------------" +domain_index=0 for d in "${DOMAINS2TEST[@]}"; do if [[ -n "$d" ]] && [[ ! $d =~ ^#.* ]]; then - totaldomains=$((totaldomains + 1)) - printf '%8s %s\n' "t$totaldomains" "$d" + ((domain_index++)) + printf '%8s %s\n' "t$domain_index" "$d" fi done -unset totaldomains +unset domain_index -printf '\n\n%s\n\n' "LOCAL THEN ALPHABETICAL BY SERVER ($SrceFileNE.log)" +printf '\n\n%s\n\n' "LOCAL THEN ALPHABETICAL BY SERVER ($SrceFileNm.log)" # REDIRECT STDOUT TO TEE IN ORDER TO DUPLICATE THE OUTPUT TO THE TERMINAL AS WELL AS A .LOG FILE -exec > >(tee "$SrceFllPth.log") +exec > >(tee "$SrceFolder/$SrceFileNm.log") eval printf '$nsl' "Server" for d in "${DOMAINS2TEST[@]}"; do @@ -196,24 +197,24 @@ done exec >/dev/tty 2>&1 # SUMMARY REPORTS -header_row=$(head -n 2 "$SrceFllPth.log") # Get the reusable results header row +header_row=$(head -n 2 "$SrceFolder/$SrceFileNm.log") # Get the reusable results header row # SORT LOGGED OUTPUT BY FASTEST MEDIAN RESPONSE TIME -read -r third_line < <(head -n 3 "$SrceFllPth.log" | tail -n 1) -num_fields=$(echo "$third_line" | awk '{print NF}') -tail -n +3 "$SrceFllPth.log" | sort -k "$((num_fields - 1))" -k "$num_fields" -n -o "$SrceFllPth.sorted.log" +read -r third_line < <(head -n 3 "$SrceFolder/$SrceFileNm.log" | tail -n 1) +num_fields=$(awk '{print NF}' <<< "$third_line") +tail -n +3 "$SrceFolder/$SrceFileNm.log" | sort -k "$((num_fields - 1))" -k "$num_fields" -n -o "$SrceFolder/$SrceFileNm.sorted.log" { # Store the data how we want it presented printf '%s\n' "$header_row" # Print the summary header - grep -v "NR" "$SrceFllPth.sorted.log" # Print responding servers - grep "NR" "$SrceFllPth.sorted.log" # Print non-responsing servers -} >"$SrceFllPth".temp.log && mv "$SrceFllPth".temp.log "$SrceFllPth.sorted.log" + grep -v "NR" "$SrceFolder/$SrceFileNm.sorted.log" # Print responding servers + grep "NR" "$SrceFolder/$SrceFileNm.sorted.log" # Print non-responding servers +} >"$SrceFolder/$SrceFileNm".temp.log && mv "$SrceFolder/$SrceFileNm".temp.log "$SrceFolder/$SrceFileNm.sorted.log" -printf '\n\n%s\n\n' "ALL SERVERS BY MEDIAN RESPONSE TIME ($SrceFileNE.sorted.log)" -cat "$SrceFllPth.sorted.log" -echo +printf '\n\n%s\n\n' "ALL SERVERS BY MEDIAN RESPONSE TIME ($SrceFileNm.sorted.log)" +cat "$SrceFolder/$SrceFileNm.sorted.log" +printf "\n" # DISPLAY ONLY TIMEOUT LOGGED OUTPUT IF PRESENT -timeouts=$(grep "\*" "$SrceFllPth.sorted.log") +timeouts=$(grep "\*" "$SrceFolder/$SrceFileNm.sorted.log") if [[ -n "$timeouts" ]]; then # Check if the variable timeouts is non-empty before printing printf '\n%s\n\n' "RESULTS WITH QUERY TIMEOUTS" printf '%s\n' "$header_row" @@ -223,20 +224,18 @@ fi printf '\n%s\n\n' "RESPONDING PROVIDERS BY AVERAGED MEDIAN RESPONSE TIMES" # AVERAGE VALUES CALCULATION FOR EACH SERVER SET -declare -A sums counts -declare -A sums -declare -A counts +declare -A counts sums while IFS= read -r line; do # Loop through each line in the sorted log file - server_set=$(echo "$line" | awk '{ print $1 }' | sed 's#/.*##') # Extract the server set name (base name before the '/1', '/2', etc.) - second_to_last_num=$(echo "$line" | awk '{ print $(NF-1) }') # Extract the second-to-last number (this is the median response time) + server_set=$(awk '{ sub(/\/.*/, "", $1); print $1 }' <<< "$line") # Extract the server set name (base name before the '/1', '/2', etc.) + second_to_last_num=$(awk '{ print $(NF-1) }' <<< "$line") # Extract the second-to-last number (this is the median response time) if [[ -n "$second_to_last_num" ]]; then # If the extracted number is not empty, process it sums[$server_set]=$(awk -v sum="${sums[$server_set]:-0}" -v num="$second_to_last_num" 'BEGIN { print sum + num }') # Convert to floating-point if necessary if [[ "$second_to_last_num" != "NR" ]]; then counts[$server_set]=$((counts[$server_set] + 1)) fi fi -done < "$SrceFllPth.sorted.log" +done < "$SrceFolder/$SrceFileNm.sorted.log" sorted_sums=() # Declare an array to hold the sorted sums for server_set in "${!sums[@]}"; do # Collect the averages and server sets @@ -248,11 +247,8 @@ for server_set in "${!sums[@]}"; do # Collect th fi done -# Sort the array based on the first column (avg value) numerically -sorted_output=$(printf '%s\n' "${sorted_sums[@]}" | sort -n) - -# Print the sorted results header -eval printf '$nsl' "Provider" +sorted_output=$(printf '%s\n' "${sorted_sums[@]}" | sort -n) # Sort the array based on the first column (avg value) numerically +eval printf '$nsl' "Provider" # Print the sorted results header printf "%9s %s\n" "Average" "Servers" eval printf -- '-%.0s' "{1..$((length + 1))}" printf ' %.0s' "" From 4c4144b59bacfdb3aa7515c5f74d1e1d214be2c6 Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 19:46:28 -0700 Subject: [PATCH 18/20] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d35e969..ab2b6ff 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +*Note: This script is a majorly overhauled fork.* + # DNS Performance Test Shell script to test the performance of the most popular DNS resolvers from your location. From 285ad30ccdd93b3fa6aec9f5647647518041b01b Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 19:47:11 -0700 Subject: [PATCH 19/20] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab2b6ff..eae9292 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The accompanying ipv4 and ipv6 text files contain the redundant servers of notab * OracleDyn * Quad9 (aka 9.9.9.9) -...as well as the redundant servers of these other well-known providers: +...as well as the redundant servers of these other well-known providers (and many more): * AlternateDNS * ControlD From 31bf08b2e4d3420cbdb5643c63447d7f116d7d0b Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Thu, 15 May 2025 19:48:01 -0700 Subject: [PATCH 20/20] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eae9292..f858202 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ The accompanying ipv4 and ipv6 text files contain the redundant servers of notab # Requirements * `dig` needs to be in the PATH. If you don't have it, the script will provide instructions for where to get it. -* `bc` is no longer a requirement of this script since being forked. `awk` is used instead for greater wide-spread availability - particularly for Synology. +* `bc` is no longer a requirement of this script since being forked. `awk` is used instead for greater wide-spread availability - particularly for Synology. (this need was what initially prompted the creation of this fork) # Utilization and example output: