Skip to content

Instantly share code, notes, and snippets.

@svlapin
Created January 31, 2020 16:27
Show Gist options
  • Save svlapin/5f8d7faf3a7172e90c7190d65c59597a to your computer and use it in GitHub Desktop.
Save svlapin/5f8d7faf3a7172e90c7190d65c59597a to your computer and use it in GitHub Desktop.
#!/bin/sh
# Reads list of domain names from either stdin or from a filename provided,
# retrieving DNS records for each.
# Prints results to stdout.
while read line
do
dig $line ANY +noall +answer
done < "${1:-/dev/stdin}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment