Skip to content

Instantly share code, notes, and snippets.

@sgraham785
Created January 9, 2019 04:22
Show Gist options
  • Save sgraham785/d0484c3cf5df1e662c8db935bc8609f3 to your computer and use it in GitHub Desktop.
Save sgraham785/d0484c3cf5df1e662c8db935bc8609f3 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# USAGE: sh whois.sh /path/to/file.txt
# RESULT: domain.com ORG_NAME
for domain in `cat $1`
do
# str_domain=${domain#www.} # strip a leading www.
reg=`whois $domain | grep -i -A 1 "Registrant Name:" | tail -n 1`
str_reg=${reg#Registrant Organization:} # strip line title
echo "$domain \t $str_reg"
# sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment