When a domain expires, the website and the email stop working at once, and the registrar's grace period is not something to rely on. The expiry date is public, so you can check it yourself in a minute. This post shows how, and how to automate it.

1. Look up the expiry date with whois

whois example.com | grep -i -E "expir|renewal" 

Typical lines: Registry Expiry Date: 2027-05-14T10:21:07Z. Field names vary by registry: paid-till, Expiration Date, Expires on. Some country registries (for example .es, .de) do not publish an expiry date at all; in that case check the registrar's dashboard.

2. Prefer RDAP when whois is rate-limited

RDAP is the structured successor of whois and returns JSON:

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

3. Count the days left

exp=$(curl -s https://rdap.org/domain/example.com | jq -r '.events[] | select(.eventAction=="expiration") | .eventDate') echo $(( ( $(date -d "$exp" +%s) - $(date +%s) ) / 86400 )) days left 

4. Check the whole portfolio

for d in example.com example.org example.net; do exp=$(curl -s "https://rdap.org/domain/$d" | jq -r '.events[]? | select(.eventAction=="expiration") | .eventDate') echo "$d $exp" done | sort -k2 

Sorting by date puts the next renewal at the top. Run it from cron and mail yourself anything under 60 days.

5. Why auto-renew is not enough

  • The card on file expired or was replaced.
  • The registrar account belongs to a former employee or to the agency that built the site, and the renewal e-mails go to an address nobody reads.
  • The domain is registered by a third party on the client's behalf, so you never see the invoice.
  • Auto-renew was switched off during a transfer and never switched back.

A practical routine: put the domain, the registrar, the account owner and the expiry date in one table, review it monthly, and set the registrar contact to a shared mailbox instead of a person.

Quick check without a terminal

AttackScout has a free domain expiration check: enter a domain and see its expiry date.