Python script that checks for upcoming domain registration expiration and sends notifications when expiration is near.

Andrew Currie f5b2239328 initial commit 3 months ago
LICENSE f5b2239328 initial commit 3 months ago
README.md f5b2239328 initial commit 3 months ago
dns-domain-expiration-checker.py f5b2239328 initial commit 3 months ago
setup.py f5b2239328 initial commit 3 months ago

README.md

Checking Domain Expiration

You can install and run dns-domain-expiration-checker.py to monitor your domain names expiratiohn dates. The script is easy to install and will send you an e-mail if your domain is set to expire in the near future. You can also use the script to view the registrars and expiration dates for your domains. Examples below:

To interactively view the expiration dates and registrars for a list of domains run the script with the "--interactive " option:

$ dns-domain-expiration-checker.py --interactive --domainfile domains
Domain Name                Registrar                       Expiration Date       Days Left
google.com                 MARKMONITOR INC.                2020-09-14 00:00:00   1147

To generate an e-mail when a domain is about to expire you can pass a domain and threshold to the script:

$ dns-domain-expiration-checker.py --domainname yahoo.com --email --expiredays 90

This will generate an e-mail if the domain prefetch.net is set to expire in the next 90-days. You can also add several domains and expiration intervals to a file and pass that as an argument:

$ cat domains
yahoo.com 60
google.com 80

$ dns-domain-expiration-checker.py --domainfile domains --email --smtpserver smtp.mydomain --smtpto "biff" --smtpfrom "Root"

Installation

The dns-domain-expiration-checker.py script relies on the dateutil PiPY pacakge to normalize dates. Here are the steps to get this script working:

  1. Create a virtualenv to run dns-domain-expiration-checker in:
    $ mkproject dns-domain-expiration-checker
    
  2. Surf over to that new environment:
    $ workon dns-domain-expiration-checker
    
  3. Pull down dateutils with pip:
    $ pip install python-dateutil
    
  4. Clone this repo:
    $ git clone https://code.digitalpci.com/acurrie/domain-expiration-checker.git
    
  5. Run the script against the domains you want to check (this assume you are in the root of your virtualenv):
    $ domain-expiration-checker/ns-domain-expiration-checker.py ....
    
  6. Automate the domain checking process.