Skip to content

Instantly share code, notes, and snippets.

@daehee
Created February 20, 2020 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daehee/18670153e60d7a31e5129ee112fb713f to your computer and use it in GitHub Desktop.
Save daehee/18670153e60d7a31e5129ee112fb713f to your computer and use it in GitHub Desktop.
Convert list of domains to IPs using dig
#!/bin/sh
# call with domaintoips.sh <domain> <list of subdomains.txt>
ulimit -n 800000
while read -r domain; do dig +short $domain | grep -v '[[:alpha:]]' | sort -u >> $1-ipf.txt; done < $2
cat $1-ipf.txt | anew $1-ipz.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment