-
-
Save flashlab/4020c8d3b00bf589264b0c145f49f2d3 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" | |
"DNSpod:119.29.29.29" | |
"Aliyun:223.5.5.5" | |
"114:114.114.114.114" | |
"baidu:180.76.76.76" | |
"CNNIC:1.2.4.8" | |
) | |
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