DEV Community

How to monitor domain expiry, DNS changes and new certificates (free method plus automation)

An expired domain is one of the most avoidable outages there is, and it still happens to companies of every size. The fix is boring: check expiry dates on a schedule and get told when something changes.

Here is how to do that for free with public data, and how to automate it for many domains. Disclosure: I built an Apify Actor that does this and it is paid per domain. Everything below uses public, official sources you can query yourself.

Where the data comes from

  • RDAP is the modern replacement for WHOIS and is run by registries. A request to https://rdap.org/domain/example.com redirects to the right registry and returns JSON with an expiration event and the registrar.
  • Live DNS tells you nameservers, A records, MX records and whether an SPF record exists.
  • Certificate Transparency logs (for example crt.sh) list every TLS certificate issued for a name, which is how you spot a certificate nobody on your team requested.

Check one domain by hand

curl -sL https://rdap.org/domain/example.com | jq '.events[] | select(.eventAction=="expiration")'

Example: expiry dates for 8 well-known domains

Pulled from RDAP today (25 Nov 2026):

Domain Expires Days left Registrar
wikipedia.org 2027-01-13 49 MarkMonitor
mozilla.org 2027-01-23 59 MarkMonitor
dev.to 2027-04-05 131 Tonic
stripe.com 2027-09-11 289 SafeNames
nodejs.org 2027-09-29 307 1API
github.com 2028-10-09 683 MarkMonitor
python.org 2033-03-28 2315 Gandi
apify.com 2035-06-02 3110 Amazon Registrar

None of these are in danger. Large organisations usually auto-renew. The point is that this takes seconds per domain once automated, and the same lookup works for the 40 client domains you manage across five registrars.

What to alert on

  • Days until expiry below a threshold (45 is a sane default)
  • Nameserver changes (a common sign of a hijack or a half-finished migration)
  • A or MX record changes you did not make
  • A new certificate for your domain or a lookalike name

Automate it

My Actor, Domain Expiry, DNS and New Certificate Monitor, takes a list of domains, saves a snapshot, and on the next run returns only what changed, with an alert status per domain (ok, changed, expiring_soon, expired).

Schedule it daily and send the result to a webhook such as Slack. The first run only stores a baseline, so changes appear from the second run. Some country domain extensions have no RDAP, and crt.sh can be slow, so the Actor retries.

Price: $0.003 per domain checked, so 1,000 domains daily is $3 a day.

https://apify.com/lightdata-tools/domain-change-monitor

What would you add to the alert list? I read the comments.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.