A Bash Shell Script to do Multiple Whois Lookups

On a recent project, I was given a list of about 30 domains to redirect to a new site. I needed to get a handle on where the domains were registered and where the DNS was hosted. I could have spent a lot of time typing “whois domain-name.com” into the terminal of my Mac, or write a shell script to do the lookups for me and write the results to a file that I could quickly examine. I already had all the domains in a text file. Here’s what I did: