Skip to content

Instantly share code, notes, and snippets.

@n-johnson
Last active November 26, 2015 19:18
Show Gist options
  • Save n-johnson/da4b2256b7c584a56ed3 to your computer and use it in GitHub Desktop.
Save n-johnson/da4b2256b7c584a56ed3 to your computer and use it in GitHub Desktop.
Replacement for dig -t any since cloudflare now refuses to answer the query with the response: 'Please stop asking for ANY" "See draft-jabley-dnsop-refuse-any"'
_dig() {
local domain=$1;
local type=$2;
dig "$domain" -t "$type" \
| sed -n '/;; ANSWER SECTION/,/^$/p' \
| sed '1d' \
| sed '/^$/d';
}
adig() {
local domain=$1;
local types;
types=(soa ns a aaaa cname ds dnskey rrsig nsec txt mx);
for t in "${types[@]}"; do
_dig "$domain" "$t"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment