Skip to content

Instantly share code, notes, and snippets.

@h4sh5
Created September 21, 2020 12:44
Show Gist options
  • Select an option

  • Save h4sh5/27a3d11f10878bbd7ff2cb054daba213 to your computer and use it in GitHub Desktop.

Select an option

Save h4sh5/27a3d11f10878bbd7ff2cb054daba213 to your computer and use it in GitHub Desktop.
query all DNS records
#!/bin/bash
if (( $# != 1 )); then
echo "Usage: $0 <host> [ns server]"
exit 1
fi
HOST=$1
types=(A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME CSYNC DHCID DLV DNAME DNSKEY DS EUI48 EUI64 HINFO HIP IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM OPENPGPKEY PTR RRSIG RP SIG SMIMEA SOA SRV SSHFP TA TKEY TLSA TSIG TXT URI)
for t in "${types[@]}"; do host -t $t $1 $2 | grep -v "has no .* record"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment