How do you do a zero-downtime DNS cutover?
IntermediateProductionDNS & Traffic Management in Production
Answer
- Lower TTL to 60s at least one old-TTL ago. 2. Stand up the new endpoint and test it with
curl --resolve. 3. Add it with weight 0, then shift weight 1%, 10%, 50%, 100% while watching errors. 4. Keep the old endpoint serving until traffic drains, remembering stale resolver caches. 5. Restore TTL.
curl --resolve app.example.com:443:203.0.113.20 https://app.example.com/health
More on DNS & Traffic Management in Production
What TTL values do you choose for production records?BeginnerHow would you design DNS for high availability?AdvancedHow do you manage DNS as code?BeginnerWhy does DNS failover take longer than expected, and how do you make it faster?AdvancedHow do Route 53 health checks work and what are their pitfalls?IntermediateHow do you run internal service DNS across multiple VPCs and accounts?Intermediate