Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8bddbeb
major changes for compatibility and usability
michealespinola Dec 15, 2022
434102b
Major changes to information format/display
michealespinola Apr 28, 2023
902299b
Made log read safer with '-r'
michealespinola Apr 28, 2023
eec023d
Revised basics of how different this version is
michealespinola Apr 28, 2023
977d657
Updated log example to reflect recent changes
michealespinola Apr 30, 2023
8233385
Updated sorted log results
michealespinola Apr 30, 2023
df7f496
default target lists for tests
michealespinola May 15, 2025
b0d86e8
Significant changes
michealespinola May 15, 2025
f0d7a15
updated example log to reflect code changes
michealespinola May 15, 2025
ab4ef16
added additional clarity
michealespinola May 15, 2025
a9fc7b5
fixed spacing
michealespinola May 15, 2025
9c39f71
fixed typo
michealespinola May 15, 2025
e812f37
Delete Dockerfile
michealespinola May 15, 2025
6e493c6
Delete results.md
michealespinola May 15, 2025
6c6d943
Delete LICENSE.txt
michealespinola May 15, 2025
07d095c
clarification
michealespinola May 15, 2025
480ad7f
optimizations
michealespinola May 16, 2025
4c4144b
Update README.md
michealespinola May 16, 2025
285ad30
Update README.md
michealespinola May 16, 2025
31bf08b
Update README.md
michealespinola May 16, 2025
2b774b9
Add dnsreload.sh to manage DNS service cache clearing
michealespinola Apr 27, 2026
28f1697
Update dnstest.sh
michealespinola Apr 27, 2026
9d343d2
Updated example output to reflect latest script changes
michealespinola Apr 27, 2026
62cee27
Update README to mention incomplete IPv6 processing
michealespinola Apr 27, 2026
fbf87bb
Update README to correct script execution comment
michealespinola Apr 28, 2026
f3c7bce
Create LICENSE
michealespinola May 9, 2026
e3028fb
Delete LICENSE
michealespinola May 9, 2026
2291353
Add GNU GPL v3 license
michealespinola May 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

16 changes: 1 addition & 15 deletions LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
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
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Expand Down
353 changes: 251 additions & 102 deletions README.md

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions dnsreload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck source=/dev/null
# bash /volume1/homes/admin/scripts/bash/dnsreload.sh

check_pid_in_docker() { # Function to check if a PID belongs to a Docker container
local pid="$1" # Assigns the first argument to a local variable 'pid'
if [[ -f "/proc/$pid/mountinfo" ]]; then # Check if /proc/$pid/mountinfo exists, which provides details about a process's mounts
if container_id=$(awk -F'docker/containers/|/' '\
{for (i=2;i<=NF;i++) \
if ($i ~ /^[0-9a-f]{64}$/) {print $i; exit}}' "/proc/$pid/mountinfo"); then # Extract container ID from the mountinfo file if the process is in a Docker container
container_name=$(docker ps --filter "id=$container_id" --format '{{.Names}}' 2>/dev/null) # Get the container name from the Docker container ID
if [[ -n "$container_name" ]]; then # If a container name is found, return it, else return an empty string
echo "$container_name"
else
echo ""
fi
else
echo "" # If container ID is not found, return an empty string
fi
else # Print an error if /proc/$pid/mountinfo is not found for the process
printf '%16s %s\n' "Error:" "/proc/$pid/mountinfo not found"
fi
}

restart_dns_service() { # Function to restart DNS services based on their type (daemon or Docker)
local service_name="$1" # The name of the DNS service
local type_name="$2" # Type of service (daemon or docker)
local container_name="$3" # Docker container name (optional)
case "$type_name" in
"daemon")
printf '%16s %s\n' "Type:" "$type_name" # Print the type of service (daemon)
case "$service_name" in # Based on the service name, call the appropriate DNS reload command
"pihole" | "pihole-FTL") # Reload Pi-hole DNS
printf '%16s %s\n' "Action:" "Reloading Pi-hole DNS ($service_name)"
pihole restartdns reload \
2> >(grep -v "utils\.sh:.*readonly variable" >&2) # Suppress specific error messages related to readonly variables in Pi-hole's utils.sh
;;
"AdGuardHome") # Reload AdGuard Home DNS
printf '%16s %s\n' "Action:" "Reloading AdGuard DNS ($service_name)"
systemctl reload AdGuardHome
;;
"named") # Reload BIND DNS
printf '%16s %s\n' "Action:" "Reloading BIND DNS ($service_name)"
rndc reload
;;
"unbound") # Reload Unbound DNS
printf '%16s %s\n' "Action:" "Unbound DNS ($service_name)"
unbound-control reload
;;
*) # Handle undefined service names
printf '%16s %s\n' "Error:" "undefined $service_name ($type_name)"
;;
esac
;;

"docker")
printf '%16s %s\n' "Type:" "$type_name ($container_name)" # Print the service type with the Docker container name
case "$service_name" in # Based on the service name, call the appropriate DNS reload command inside the Docker container
"pihole" | "pihole-FTL") # Reload Pi-hole DNS inside Docker
printf '%16s %s\n' "Action:" "Reloading Pi-hole DNS ($service_name)"
docker exec "$container_name" pihole reloaddns \
2> >(grep -v "utils\.sh:.*readonly variable" >&2) # Suppress specific error messages related to readonly variables in Pi-hole's utils.sh
;;
"AdGuardHome") # Reload AdGuard DNS inside Docker
printf '%16s %s\n' "Action:" "Reloading AdGuard DNS ($service_name)"
docker exec "$container_name" /opt/adguardhome/AdGuardHome -s reload
;;
*) # Handle undefined service names
printf '%16s %s\n' "Error:" "undefined $service_name ($type_name)"
;;
esac
;;

*) # Handle unknown service types
echo "Unknown type detected: $type_name"
printf '%16s %s\n' "Error:" "undefined type ($type_name)"
;;
esac
}

if LOCALTEST=$(netstat -tulpnW | grep "\:53\b" | grep "tcp\b" | grep "LISTEN"); then # Detect the DNS service and its type by checking port 53
DNSPROT=$(awk '{ print $1 }' <<< "$LOCALTEST") # Capture the protocol (e.g., TCP or UDP) from the first field
DNSPORT=$(awk '{ split($4, a, ":"); print a[2] }' <<< "$LOCALTEST") # Capture the port number by splitting the IP:port field (field 4)
DNSPID=$(awk '{ split($7, a, "/"); print a[1] }' <<< "$LOCALTEST") # Capture the program's PID (field 7, before the '/')
DNSPROG=$(awk '{ split($7, a, "/"); gsub(/[ \t]+$/, "", a[2]); print a[2] }' <<< "$LOCALTEST") # Capture the program name (field 7, after the '/')

printf '\n%s\n\n' "CHECKING FOR LOCAL DNS SERVER AND FLUSHING CACHE"
printf '%16s %s\n' "Local DNS:" "$DNSPROT/$DNSPORT $DNSPROG (pid:$DNSPID)" # Print the detected DNS service and its details

container_name=$(check_pid_in_docker "$DNSPID") # Check if the DNS service's PID belongs to a Docker container
if [ -n "$container_name" ]; then # If the service is running inside a Docker container, reload it as a Docker service
restart_dns_service "$DNSPROG" "docker" "$container_name"
else # Otherwise, treat it as a regular daemon service
restart_dns_service "$DNSPROG" "daemon"
fi
else # Print message if no local DNS server is found listening on port 53
printf '%16s %s\n' "Local DNS:" "Not found"
fi
50 changes: 50 additions & 0 deletions dnstest.domains.txt
Original file line number Diff line number Diff line change
@@ -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
89 changes: 89 additions & 0 deletions dnstest.ipnr.txt
Original file line number Diff line number Diff line change
@@ -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
63 changes: 63 additions & 0 deletions dnstest.ipv4.txt
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions dnstest.ipv6.txt
Original file line number Diff line number Diff line change
@@ -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
Loading