whois check

——————————-To check Expiration date————————–
[root@localhost ~]# vim script 
#!/bin/bash
for domain in `cat /root/domains.txt`
do
echo $domain >> whois-results.txt
whois $domain | egrep -i “expiration date” >> whois-results.txt
echo  >> whois-results.txt
done

[root@localhost ~]# vim /root/domains.txt 
linuxmadeeasy.in
google.com
yahoo.com
puppethub.in
[root@localhost ~]# sh script 
[root@localhost ~]# cat whois-results.txt 
linuxmadeeasy.in
Expiration Date:13-Apr-2017 10:02:00 UTC
google.com
   Expiration Date: 14-sep-2020
NOTICE: The expiration date displayed in this record is the date the
Registrar Registration Expiration Date: 2020-09-13T21:00:00-0700
yahoo.com
   Expiration Date: 19-jan-2023
NOTICE: The expiration date displayed in this record is the date the
puppethub.in
Expiration Date:02-Aug-2017 13:32:05 UTC
—————————– To check Name Server —————————-
[root@localhost ~]# vim script 
#!/bin/bash
for domain in `cat /root/domains.txt`
do
   echo $domain >> whois-results.txt
   whois $domain | egrep -i “name server >> whois-results.txt
echo  >> whois-results.txt
done
[root@localhost ~]# cat whois-results.txt 
linuxmadeeasy.in
Name Server:NS43.DOMAINCONTROL.COM
Name Server:NS44.DOMAINCONTROL.COM
google.com
   Name Server: NS1.GOOGLE.COM
   Name Server: NS2.GOOGLE.COM
   Name Server: NS3.GOOGLE.COM
   Name Server: NS4.GOOGLE.COM
Name Server: ns4.google.com
Name Server: ns3.google.com
Name Server: ns1.google.com
Name Server: ns2.google.com
yahoo.com
   Name Server: NS1.YAHOO.COM
   Name Server: NS2.YAHOO.COM
   Name Server: NS3.YAHOO.COM
   Name Server: NS4.YAHOO.COM
   Name Server: NS5.YAHOO.COM
puppethub.in
Name Server:NS35.DOMAINCONTROL.COM
Name Server:NS36.DOMAINCONTROL.COM
———————————————————————————————————————-
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s