Never miss a “domain expiry” email notification ever again!
One of my websites was recently down for a couple of weeks without me noticing (it looks like the email notification got lost in the post). So to avoid this happening again I have created myself a website monitor using a Google Sheet and Apps Script.
The script runs once a night and does a few simple checks:
- whether the site is accessible
- whether the domain will expire soon (“soon” being configurable in the script)
- whether if the name servers have changed
You can run it manually using “Domain Monitor > Check domains”.
It uses a free WHOIS API developed by Jason Ormand.
There is also a progress log in the Log sheet.
If you do not know your name servers run it with this column empty and then copy over the ones returned (assuming everything is working now).
It only works for international top-level domains like .com and .net, not country specific ones like .co.uk.
Installation
- Take a copy of my sheet
- Enter your own domains – Delete my domains and list your own (excluding any “www” or “http”) in the sheet
- Set up the script properties (optional) – Go into the script editor (Tools > Script editor…) and then File > Project Properties > Script Properties. This step is optional, but you will obviously not receive email notifications and/or a link to the results sheet. Here add two rows:
- EMAIL – with the email address you want the notifications sent to
- SHEET_URL – the URL of your copy of the GSheet
- Set up the trigger – Go to “Resources > Current project’s triggers” and add a trigger:
- to run checkDomains()
- time-driven
- at whatever frequency you like – I use daily
- and at whatever time – I run mine at 1am
You can also simply copy the script into your own sheet from the gist. There are a couple of things to note if you take this route:
- You will need the “Log” library – MqTFuiXcPtS5rVUZ_jC9Z4tnfWGfgtIUb
- The sheet with the list of domains will have to have the same columns and be named “Domains”
Great little tool, I wasnt however able to get the expiration dates to work. Receiving null response from the api, any ideas?
Thanks for flagging this up. It looks like I’ve not been able to get expiration dates for over a year also, they must have dropped that service. I’ll take a look, hopefully between us we can come up with something!
Whilst I’m looking at this I’ve upgraded my code to send me an email when it can’t get the expiration date.
Just come across this, and love the idea. Actually the whois still works for .co.uk and .uk but fails for .com etc
Have started looking at alternative API’s, but they are all quite expensive so far…whoxy.com looks cheapest, but no free level.
The expiration issue has now been fixed – thanks to a contribution from another user (thanks Debbie!).
If you take a copy of the demo sheet, from which you can copy the latest code you should be good to go. Or you can also get the latest script from GitHub (copy it into the script editor “Tools > Script editor”.
https://github.com/andrewroberts/Domain_Monitoring/blob/master/Code.gs