Created
May 10, 2018 17:25
-
-
Save Rudis1261/5afbb70714273d0c55c457bce2d70562 to your computer and use it in GitHub Desktop.
A script I used to compare my old DNS v.s my new DNS to ensure all the records match
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 | |
server=$2 | |
dig +nocmd +multiline +noall +answer "${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1 | |
dig +nocmd +multiline +noall +answer "${domain}" MX "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1 | |
dig +nocmd +multiline +noall +answer "www.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}'| sort -u -k1 | |
dig +nocmd +multiline +noall +answer "mail.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1 | |
dig +nocmd +multiline +noall +answer "mail._domainkey.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1 | |
dig +nocmd +multiline +noall +answer "_acme-challenge.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
chmod +x test_dns_records.sh #./test_dns_records.sh <domain_name> <dns_server> ./test_dns_records.sh example.com ns.dns.com