DNS Propagation: The TTL Trap
Learn the principles of UDP networking, edge caching hierarchies, and why migrating a domain name is generally the most dangerous operation an engineer performs.
What is DNS TTL (Time To Live)?
When a user types your website into a browser, their computer must ask a Global Name Server to translate your domain into an IP address. To prevent these Name Servers from instantly melting under trillions of requests, the response includes a TTL (Time To Live).
If your TTL is `86,400` seconds (24 hours), the user's internet provider (like Comcast or AT&T) will actively store and remember your IP address. It will not ask again for another 24 hours.
The Server Migration Disaster
If you build a brand new server and update your DNS records to point to it, you cannot force the internet to update.
If your old TTL was set to 24 hours, any user who visited your website yesterday is physically locked to the old server. When they type your URL, their ISP uses the cached record and routes them directly to the old IP. You will experience "Split Brain" traffic—50% of your users hitting the old database, and 50% hitting the new database, destroying your data integrity entirely.
The Pre-Migration Protocol
Professional SysAdmins execute migrations via a 48-hour protocol:
- 48 Hours Before: Lower the domain's TTL from 86400 (24h) down to 300 (5 minutes). Do not change the IP yet.
- Wait: You must wait exactly 48 hours to ensure every ISP globally has flushed the old 24h cache and replaced it with the 5-minute cache.
- Execute: Change the IP address to the new server. Because the TTL is now globally 5 minutes, the entire internet updates to the new IP address almost instantly.