Domain Expiration Check Shell Script


I’ve already written about a shell script to check / monitor domain renew / expiration date here. Now I’ve modified matt’s domain-check script to support additional C/TLDs .in, .biz, .org and .info domains. I’ve also added 5 seconds delay to avoid whois server rejecting query. This script checks to see if a domain has expired. It can be run in interactive and batch mode, and provides facilities to alarm if a domain is about to expire in advance.
Sample usage

Display expiration date and registrar for domain:

domain-check-2 -d {domain-name}

$ domain-check-2 -d

Domain Registrar Status Expires Days Left
----------------------------------- ----------------- -------- ----------- --------- et4India (R7-AFIN Valid 28-Oct-2009 799

You can also get an email if going to expire in 30 days

domain-check-2 -a -d -q -x 30 -e

However most killer feature is you can read list of domain names from a file such as mydomains.txt (list each domain on a new line):

$ domain-check-2 -a -f mydomains.txt -q -x 30 -e
$ domain-check-2 -f mydomains.txt


Domain Registrar Status Expires Days Left
----------------------------------- ----------------- -------- ----------- --------- et4India (R7-AFIN Valid 28-Oct-2009 799, Inc. Valid 13-Aug-2009 723 MONIKER ONLINE SE Valid 18-aug-2010 1093 Valid 30-Jun-2009 679 Inc. ( Valid 26-Jun-2009 675 GODADDY.COM, INC. Valid 11-dec-2009 843


=> Download modified domain-check-2 script here.
Quick installation

Use wget command to download and install domain-check script:
$ wget
$ mv domain-check-2.txt domain-check
$ chmod +x domain-check
$ ./domain-check -d

Make sure you run the domain-check script using a cron job.


I am a g33k, Linux blogger, developer, student and Tech Writer for My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.