Agent Wranglers

INF-36Recommended

Shorten the TTL before you move a record

Before you point a name at a new server, shorten its TTL and wait one full old TTL. Restore the longer TTL after the move.

How to do it

Resolvers keep an answer for as long as its TTL says. Change the TTL from 3600 to 300 seconds, at least 3600 seconds before the move. After the move, a mistake then lasts 5 minutes instead of an hour. When the new server has run cleanly for a day, set the TTL back to 3600. A move of the whole domain also follows Move a site or domain without losing links.

Examples

Shell example

dig +noall +answer shop.example.com @1.1.1.1   # shop.example.com. 300 IN A 203.0.113.10

How to check

Before the move window, dig on a public resolver shows a TTL of 300 or less for the name.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/infrastructure/networking-and-dns/lower-ttl-before-changes">Agent Wranglers infrastructure and environments playbook</a>. In code you write, add a comment next to it with the same link.