{"id":1485,"date":"2026-09-03T12:16:49","date_gmt":"2026-09-03T06:46:49","guid":{"rendered":"https:\/\/cpanelfree.com\/blog\/what-is-dns-ttl-best-values-before-migration\/"},"modified":"2026-09-03T12:31:16","modified_gmt":"2026-09-03T07:01:16","slug":"what-is-dns-ttl-best-values-before-migration","status":"publish","type":"post","link":"https:\/\/cpanelfree.com\/blog\/what-is-dns-ttl-best-values-before-migration\/","title":{"rendered":"What is DNS TTL (Time to Live) and What Value Should You Set Before Migration?"},"content":{"rendered":"<div style=\"background-color: #f8fafc;border-left: 4px solid #f59e0b;padding: 20px;border-radius: 6px;margin-bottom: 25px\">\n<p style=\"margin: 0;font-size: 16px;color: #1e293b\">\n        <strong>Quick Answer:<\/strong> <strong>DNS TTL (Time to Live)<\/strong> is a numerical value (measured in seconds) that tells recursive DNS resolvers and ISP caching servers how long to cache a DNS record before requesting fresh data from the authoritative nameserver. <strong>24 to 48 hours before migrating a website<\/strong>, you should lower your A record TTL to <strong>300 seconds (5 minutes)<\/strong> to ensure visitors switch to your new server IP almost instantly upon migration.\n    <\/p>\n<\/div>\n<h2>How DNS TTL Works Under the Hood<\/h2>\n<p>Every DNS record (A, CNAME, MX, TXT) includes a TTL integer. When a user in London queries your website, their local ISP resolver caches your server IP address for the duration of the TTL. If your TTL is set to <code>86400<\/code> (24 hours), the ISP will not check your authoritative nameservers again for a full day.<\/p>\n<p>If you migrate to a new server IP while your TTL is 24 hours, users will continue sending database transactions and eCommerce orders to your obsolete old server for up to 24 hours, resulting in split-brain data loss.<\/p>\n<h2>The 3-Phase TTL Migration Strategy<\/h2>\n<h3>Phase 1: Pre-Migration (24\u201348 Hours Before Migration)<\/h3>\n<p>Access your DNS editor (cPanel Zone Editor, Cloudflare, or Route 53) and lower the TTL on your primary records:<\/p>\n<table style=\"width: 100%;border-collapse: collapse;margin: 20px 0;font-size: 14px\">\n<thead>\n<tr style=\"background-color: #0f172a;color: #ffffff\">\n<th style=\"padding: 10px;border: 1px solid #334155\">Record Name<\/th>\n<th style=\"padding: 10px;border: 1px solid #334155\">Standard Production TTL<\/th>\n<th style=\"padding: 10px;border: 1px solid #334155\">Pre-Migration Target TTL<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background-color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;font-weight: bold\">Root Apex (@) A Record<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">86,400s (24 Hours)<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;color: #10b981\"><strong>300s (5 Minutes)<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;font-weight: bold\">www CNAME \/ A Record<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">86,400s (24 Hours)<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;color: #10b981\"><strong>300s (5 Minutes)<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Phase 2: Migration Cutover Day<\/h3>\n<p>Once the old 24-hour cache window has elapsed, import your final database dump to the new server and update the A record to your new server IP. Because the TTL is 300 seconds, <strong>99% of global traffic shifts to the new server in under 5 minutes<\/strong>.<\/p>\n<h3>Phase 3: Post-Migration Stabilization<\/h3>\n<p>After verifying site stability for 48 hours on the new server, restore your TTL back to <strong>86,400 seconds (1 day)<\/strong>. This reduces unnecessary DNS query traffic to your nameservers and speeds up browsing for repeat visitors.<\/p>\n<h2>Understanding DNS Caching Hierarchies (Browser, OS, ISP, Root)<\/h2>\n<p>When a DNS lookup occurs, cached data is stored at 4 distinct hierarchical layers, each governed by TTL rules:<\/p>\n<ol style=\"padding-left: 20px;line-height: 1.8\">\n<li><strong>Browser DNS Cache:<\/strong> Google Chrome and Firefox cache IPs in memory for 60 seconds regardless of TTL.<\/li>\n<li><strong>Operating System Resolver Cache:<\/strong> Windows DNS Client and macOS mDNSResponder cache records based on record TTL.<\/li>\n<li><strong>Local Router &amp; ISP Cache:<\/strong> Network gateways and ISP recursive servers cache records up to the full TTL duration.<\/li>\n<li><strong>Authoritative Nameservers:<\/strong> The ultimate source of truth holding your master DNS zone file.<\/li>\n<\/ol>\n<p>Lowering your TTL to 300s ensures that layers 2 and 3 purge obsolete data almost instantaneously.<\/p>\n<h2>Negative TTL and SOA Record Tuning<\/h2>\n<p>The Start of Authority (SOA) record contains a <strong>Minimum TTL (Negative Caching TTL)<\/strong> value. If an external resolver queries a non-existent subdomain (NXDOMAIN), this setting dictates how long the failure state is cached. Keep this value between 300s and 3600s during active migration windows.<\/p>\n<h2>Analyzing Real-World Bandwidth and Server Load Impact of TTL Settings<\/h2>\n<p>Setting DNS TTL involves a fundamental engineering trade-off between <strong>traffic agility<\/strong> and <strong>nameserver infrastructure load<\/strong>:<\/p>\n<ul style=\"padding-left: 20px;line-height: 1.8\">\n<li><strong>Ultra-Low TTL (60s to 300s):<\/strong> Grants maximum flexibility during server migrations or blue-green failover scenarios. However, it increases DNS query volume to your authoritative nameservers by up to 20x.<\/li>\n<li><strong>Standard High TTL (86,400s \/ 24 Hours):<\/strong> Caches records across ISP resolvers globally, eliminating redundant nameserver queries and providing maximum resilience if your primary nameserver experiences temporary downtime.<\/li>\n<\/ul>\n<h2>DNS TTL for Different Service Records<\/h2>\n<table style=\"width: 100%;border-collapse: collapse;margin: 20px 0;font-size: 14px\">\n<thead>\n<tr style=\"background-color: #0f172a;color: #ffffff\">\n<th style=\"padding: 10px;border: 1px solid #334155\">Record Type<\/th>\n<th style=\"padding: 10px;border: 1px solid #334155\">Recommended TTL<\/th>\n<th style=\"padding: 10px;border: 1px solid #334155\">Technical Rationale<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background-color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;font-weight: bold\">Web Server A Record<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">86,400s (Lower to 300s for migrations)<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">Balances speed with agility<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;font-weight: bold\">Email MX Record<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">86,400s (24 Hours)<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">Mail infrastructure changes rarely<\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;font-weight: bold\">Security TXT (SPF\/DKIM)<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">3,600s (1 Hour)<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">Allows rapid mail deliverability updates<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div style=\"background-color: #f8fafc;border: 1px solid #e2e8f0;border-left: 4px solid #0ea5e9;padding: 20px;border-radius: 8px;margin: 30px 0\">\n<h3 style=\"margin-top: 0;color: #0f172a;font-size: 18px;display: flex;align-items: center\">\n        <span style=\"margin-right: 8px\">\ud83d\udd17<\/span> Recommended Related Technical Guides:<br \/>\n    <\/h3>\n<ul style=\"margin: 10px 0 0 0;padding-left: 20px;line-height: 1.8\">\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-setup-free-cloudflare-cdn-dns-hosting\/\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">How to Set Up Free Cloudflare CDN &amp; DNS on Any Web Hosting<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/dns-a-record-vs-cname-vs-alias-guide\/\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">DNS A Record vs CNAME vs ALIAS Explained<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-fix-dns-probe-finished-nxdomain-error\/\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">How to Fix DNS_PROBE_FINISHED_NXDOMAIN Error<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/best-free-web-hosting-2026\/\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">Top 10 Best Free Web Hosting Services<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/#plans\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">Explore $0 Free cPanel Web Hosting Plans<\/a><\/li>\n<\/ul>\n<\/div>\n<div style=\"background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);border: 1px solid #334155;border-radius: 12px;padding: 25px;margin: 30px 0;text-align: center\">\n<h3 style=\"color: #38bdf8;margin-top: 0;font-size: 20px\">Zero-Downtime Web Hosting on CpanelFree<\/h3>\n<p style=\"color: #94a3b8;font-size: 14px;line-height: 1.6;max-width: 600px;margin: 0 auto 15px\">\n        Migrate your websites to <strong>CpanelFree<\/strong> with zero downtime. Enjoy high-speed NVMe SSD storage, cPanel control, and unmetered bandwidth at $0 cost forever.\n    <\/p>\n<p>    <a href=\"https:\/\/cpanelfree.com\/#plans\" style=\"display: inline-block;background-color: #f59e0b;color: #ffffff;padding: 10px 22px;border-radius: 6px;text-decoration: none;font-weight: bold;font-size: 14px\">Claim Free Hosting Account<\/a>\n<\/div>\n<h2>Frequently Asked Questions<\/h2>\n<div style=\"border-bottom: 1px solid #e2e8f0;padding: 12px 0\">\n<h4 style=\"margin: 0 0 8px 0;color: #1e293b\">Why shouldn&#8217;t I leave TTL at 300 seconds permanently?<\/h4>\n<p style=\"margin: 0;color: #475569;font-size: 14px\">Low TTL forces client browsers to perform fresh DNS lookups frequently, increasing page load latency and consuming more nameserver lookup bandwidth.<\/p>\n<\/div>\n<h2>Configuring DNS TTL in Popular Cloud Dashboards (Cloudflare, cPanel, Route 53)<\/h2>\n<p>In Cloudflare, setting TTL to <strong>Auto<\/strong> enforces a default 300-second (5 minute) TTL on all proxied records. In cPanel Zone Editor and AWS Route 53, you can manually enter numerical second values (e.g. <code>300<\/code> for migration mode or <code>86400<\/code> for standard production).<\/p>\n<div style=\"border-bottom: 1px solid #e2e8f0;padding: 12px 0\">\n<h4 style=\"margin: 0 0 8px 0;color: #1e293b\">How long before migrating should I lower my TTL?<\/h4>\n<p style=\"margin: 0;color: #475569;font-size: 14px\">Lower your TTL at least 24 to 48 hours prior to changing your server IP to ensure that all worldwide ISP caches have expired their previous long-term entries.<\/p>\n<\/div>\n<p>Mastering DNS Time to Live values allows system administrators to balance day-to-day caching efficiency with rapid agility during critical server migrations and emergency disaster recovery scenarios.<\/p>\n<div style=\"background-color: #f1f5f9;padding: 15px;border-radius: 8px;margin: 20px 0\">\n<h4 style=\"margin-top: 0;color: #1e293b\">Pro Sysadmin Tip: Monitoring Active DNS TTL Countdown<\/h4>\n<p style=\"margin: 0;color: #475569;font-size: 14px\">Inspect how many seconds remain on a cached DNS record using the dig command: <code>dig yourdomain.com +nocmd +noall +answer<\/code>. The second column displays the live remaining TTL countdown in seconds until the next authoritative refresh.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Quick Answer: DNS TTL (Time to Live) is a numerical value (measured in seconds) that tells recursive DNS resolvers and ISP caching servers how long to cache a DNS record before requesting fresh data from the authoritative nameserver. 24 to 48 hours before migrating a website, you should lower your A record TTL to 300 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1484,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"class_list":["post-1485","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1485","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/comments?post=1485"}],"version-history":[{"count":6,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1485\/revisions"}],"predecessor-version":[{"id":1541,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1485\/revisions\/1541"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media\/1484"}],"wp:attachment":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media?parent=1485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/categories?post=1485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/tags?post=1485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}