Skip to content

Instantly share code, notes, and snippets.

@Atavic
Last active October 9, 2016 17:09
Show Gist options
  • Save Atavic/bf6c56322eefbde89ea7c7d0e134058c to your computer and use it in GitHub Desktop.
Save Atavic/bf6c56322eefbde89ea7c7d0e134058c to your computer and use it in GitHub Desktop.
query domain SPF record
domainsToDig=$(dig @8.8.8.8 _spf.google.com TXT +short | \
sed \
-e 's/"v=spf1//' \
-e 's/ ~all"//' \
-e 's/ include:/\n/g' | \
tail -n+2)
for domain in $domainsToDig ; do
dig @8.8.8.8 $domain TXT +short | \
sed \
-e 's/"v=spf1//' \
-e 's/ ~all"//' \
-e 's/ ip.:/\n/g' | \
tail -n+2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment