Created
February 8, 2020 08:01
-
-
Save kbence/0cc95109f5228bd919fef4c34247655e to your computer and use it in GitHub Desktop.
Script to check number of dig DNS results for a few free DNS servers out there.
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
#!/usr/bin/env bash | |
DNS_SERVERS=" | |
8.8.8.8 8.8.4.4 | |
1.1.1.1 | |
208.67.222.222 208.67.220.220 | |
199.85.126.10 199.85.127.10 | |
8.26.56.26 8.20.247.20 | |
9.9.9.9 149.112.112.112 | |
64.6.64.6 64.6.65.6 | |
" | |
parallel echo BEGIN {} \; dig @{} "$1" \; echo END {} ::: $DNS_SERVERS | egrep -v '(^;|^$)' \ | |
| IFS=$'\t' awk ' | |
$1 == "BEGIN" {dns=$2; count[dns]=0} | |
$1 != "BEGIN" && $1 != "END" {count[dns]++} | |
$1 == "END" {printf "%-15s %2d\n", dns, count[dns]} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment