Last active
September 23, 2021 22:10
-
-
Save imxari/eb2a43defd4b7427f02f636d70a6a505 to your computer and use it in GitHub Desktop.
domain-dns.sh - Get DNS records for a registered domain
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 | |
| # ================================================== | |
| # | |
| # Script: domain-dns.sh | |
| # By: Xari (noreply@xarihosted.co.uk) | |
| # Github: https://github.com/imxari | |
| # | |
| # Synopsis: DIG a domain for DNS records and output | |
| # Usage: ./domain-dns.sh <domain> | |
| # | |
| # ================================================== | |
| # Has the domain been provided from the CLI? | |
| if [ -z $1 ]; then | |
| echo "[-] Error, please provide a domain to dig!" | |
| echo "Usage: ./domain-dns.sh <domain>" | |
| fi | |
| # Define the records to find | |
| RECORDS=(NS A AAAA MX TXT CNAME) | |
| # DIG the domain | |
| for i in "${RECORDS[@]}" | |
| do | |
| echo $(tput setaf 5)"<| $i Records |>" | |
| echo $(tput setaf 2) "-------------------------------------------------------" $(tput setaf 6) | |
| dig +nocmd +multiline +noall +answer $i $1 | |
| echo $(tput setaf 2) "-------------------------------------------------------" $(tput setaf 7) | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment