Skip to content

Instantly share code, notes, and snippets.

@alexpls
Created July 11, 2016 04:10
Show Gist options
  • Save alexpls/d25a57a97525a45db88738f4d5f15a5b to your computer and use it in GitHub Desktop.
Save alexpls/d25a57a97525a45db88738f4d5f15a5b to your computer and use it in GitHub Desktop.
Filter a list of domains keeping only those which have a valid MX record
awk '{print $1}' domains.txt | while read domain; do if [[ $(dig +noall +answer mx $domain) ]]; then echo $domain; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment