Agent Wranglers

Networking and DNS Recommended

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.

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.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers infrastructure playbook: https://agentwranglers.se/playbook/infrastructure/networking-and-dns/lower-ttl-before-changes.