Send notifications when DNS domains are about to expire.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE Create LICENSE Nov 14, 2017 Update Aug 2, 2017 Update Jun 5, 2018 Create Aug 4, 2017

Checking DNS Domain Expiration

If you are here you may have had a domain expire and dealt with the annoyances that go with reclaiming it. It's no fun is it? To prevent yourself from dealing with this again you can install and run to monitor your domains. 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. Now to some examples.

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

$ --interactive --domainfile domains
Domain Name                Registrar                       Expiration Date       Days Left               DNC HOLDINGS, INC.              2020-06-23 00:00:00   1064                 GANDI SAS                       2017-12-03 00:00:00   131                 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:

$ --domainname --email --expiredays 90

This will generate an e-mail if the domain 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 60 60 2000 80

$ --domainfile domains --email --smtpserver smtp.mydomain --smtpto "biff" --smtpfrom "Root"


The 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
  1. Surf over to that new environment:
$ workon dns-domain-expiration-checker
  1. Pull down dateutils with pip:
$ pip install python-dateutil
  1. Clone this repo:
$ git clone
  1. Run the script against the domains you want to check (this assume you are in the root of your virtualenv):
$ dns-domain-expiration-checker/ ....
  1. Automate the domain checking process.