If you manage a list of domains it’s sometimes helpful to have a script like this to check the information from time to time.
I plan to clean this up in time but for now this works.
First create a text file like below that has domains in it
google.com yahoo.com microsoft.com
Then create and run this bash/shell script
#!/bin/sh # whois-DomainList.sh # # # Created by David Kittell on 8/25/16. # # Variables - Start dt=$(echo `date +%Y_%m_%d_%H.%M.%S`) sDatedName="DomainListDetails_$dt.txt" # Variables - Stop #echo "Domain Information for $1" #whois $1 | egrep -i 'Expiration Date:|Expires on|Registrar:|Name Server:' echo "Running Process..." rm $sDatedName cat domainlist.txt | while read line; do lLine="$(echo $line | tr '[A-Z]' '[a-z]')" echo "\n$lLine\n" >> $sDatedName; echo "\n$lLine" case "$lLine" in *".healthcare"*) #echo domain is .healthcare host=whois.donuts.co #echo $lLine #echo $host echo -i "whois -h whois.donuts.co $line | egrep -i 'Registry Expiry Date:|Sponsoring Registrar:|Name Server:'" whoisinfo=$(whois -h whois.donuts.co $line | egrep -i 'Registry Expiry Date:|Sponsoring Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".is"*) #echo domain is .is host=whois.isnic.is whoisinfo=$(whois -h $host $lLine | egrep -i 'expires:|nserver:|source:|role:') echo $whoisinfo >> $sDatedName ;; *".pharmacy"*) #echo domain is .pharmacy host=whois.nic.pharmacy whoisinfo=$(whois -h $host $lLine | egrep -i 'Registry Expiry Date:|Sponsoring Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".cc"*) #echo domain is .pharmacy host=whois.nic.cc whoisinfo=$(whois -h $host $lLine | egrep -i 'Expiration Date:|Expires on|Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".coop"*) #echo domain is .pharmacy host=whois.nic.coop whoisinfo=$(whois -h $host $lLine | egrep -i 'Expiration Date:|Expires on|Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".edu"*) #echo domain is .pharmacy host=whois.educause.edu whoisinfo="Registrar: Educause.edu\n$(whois -h $host $lLine | egrep -i 'Domain expires:' && whois -h $host $lLine | grep -A5 'Name Servers:')" echo $whoisinfo >> $sDatedName ;; *".im"*) #echo domain is .pharmacy host=whois.nic.im whoisinfo=$(whois -h $host $lLine | egrep -i 'Expiration Date:|Expires on|Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".pro"*) #echo domain is .pharmacy host=whois.RegistryPro.pro whoisinfo=$(whois -h $host $lLine | egrep -i 'Expiration Date:|Expires on|Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".tv"*) #echo domain is .pharmacy host=whois.nic.tv whoisinfo=$(whois -h $host $lLine | egrep -i 'Expiration Date:|Expires on|Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".us"*) #echo domain is .pharmacy host=whois.nic.us whoisinfo=$(whois -h $host $lLine | egrep -i 'Expiration Date:|Expires on|Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".org"*) #echo domain is .org host=whois.pir.org whoisinfo=$(whois -h $host $lLine | egrep -i 'Registry Expiry Date:|Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".biz"*) #echo domain is .biz host=whois.biz whoisinfo=$(whois -h $host $lLine | egrep -i 'Expiration Date:|Expires on|Sponsoring Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *".info"*) #echo domain is .info host=whois.afilias.info whoisinfo=$(whois -h $host $lLine | egrep -i 'Registry Expiry Date:|Sponsoring Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; *) #echo unknown host=whois.crsnic.net whoisinfo=$(whois -h $host $lLine | egrep -i 'Expiration Date:|Expires on|Registrar:|Name Server:') echo $whoisinfo >> $sDatedName ;; esac echo " -> $host" echo $whoisinfo echo "------------------------------------------" >> $sDatedName done #echo "\nName Server Information" #nslookup -query=ns $1 | egrep -i 'nameserver' | awk '{print $4}' # | cut -d/ -f1 echo "Process complete" exit
Last Updated on September 2, 2016