Skip to content

Instantly share code, notes, and snippets.

@joeashcraft
Created January 22, 2016 19:56
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 joeashcraft/94668c5aba852e2b147d to your computer and use it in GitHub Desktop.
Save joeashcraft/94668c5aba852e2b147d to your computer and use it in GitHub Desktop.
lookup a list of domains, return IP's (follow CNAME's to the last A) or NONE
for d in google.com www.google.com rackspace.com www.rackspace.com ; do
echo -n "$d : "
result=$(dig +short "$d" | tail -n1)
if [ -z "$result" ]; then
echo NONE
else
echo "$result"
fi
done | column -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment