Created
November 2, 2025 16:34
-
-
Save bradmontgomery/d49399ae250acad2ac5fcda001f755ee to your computer and use it in GitHub Desktop.
Quick & Dirty bash script to do a DNS query against several well-known DNS Servers.
This file contains hidden or 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 | |
| DOMAIN=$1; | |
| if [ -z "$DOMAIN" ]; then | |
| echo "USAGE: ./digger <your-domain>" | |
| else | |
| echo "Testing $DOMAIN" | |
| # Here's a list of public name servers. | |
| # See: https://www.lifewire.com/free-and-public-dns-servers-2626062 | |
| declare -a nameservers=("209.244.0.3" "64.6.64.6" "8.8.8.8" "84.200.69.80" "8.26.56.26" "208.67.222.222" "199.85.126.10" "81.218.119.11" "195.46.39.39" "96.90.175.167" "208.76.50.50" "216.146.35.35" "37.235.1.174" "77.88.8.8" "91.239.100.100" "74.82.42.42" "109.69.8.51") | |
| for ns in "${nameservers[@]}" | |
| do | |
| RESULT=$(dig @$ns +short $DOMAIN) | |
| echo "GOT: $RESULT <--- from: ${ns}" | |
| done | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment