Last active
February 6, 2024 06:45
-
-
Save westh/653121759ad9bfb7f821e735ea32b263 to your computer and use it in GitHub Desktop.
π₯ a small distributed DNS checker β much like dnschecker.org but in your terminal, you could put it in /usr/local/bin or somewhere for easy access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
servers=( | |
"Cloudflare:1.1.1.1" | |
"Google:8.8.8.8" | |
"Quad9:9.9.9.9" | |
"Verisign:64.6.65.6" | |
) | |
if [[ $# -eq 0 ]] ; then | |
echo 'π no argument was provided, please provide a domain name' | |
exit 1 | |
fi | |
for server in "${servers[@]}" ; do | |
DNS_PROVIDER="${server%%:*}" | |
PROVIDER_IP="${server##*:}" | |
printf "%s (%s):\t%s\n" "$DNS_PROVIDER" "$PROVIDER_IP" $(\ | |
dig +short @"$PROVIDER_IP" $1 \ | |
| sort -n \ | |
| sed -e 'H;${x;s/\n/,/g;s/^,//;p;};d'\ | |
) & | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
happy new year