Skip to main content

DNS changes in under 10 minutes

·2 mins
Recommended basics: Articles you should know

To get the full picture of this article, you should know about this topics:

Domain Name System (DNS)

Discover how the Domain Name System (DNS) works and why it's crucial for managing domain addresses. This guide covers DNS server hierarchy, zone files, entry types, and caching, making it an essential read for developers, sysadmins, and self-hosters.

You may also want to use the content map to find interesting articles that play into this one.


Many sources say that DNS changes can take up to 24 hours to propagate. This probably is fine if you have a static website that you move from one server to another. But if you move to a new mail server or if you have a website with dynamic content changes (like comments or shop orders), this comes with many downtimes.

Good to know:

Domain Name System (DNS)

Discover how the Domain Name System (DNS) works and why it's crucial for managing domain addresses. This guide covers DNS server hierarchy, zone files, entry types, and caching, making it an essential read for developers, sysadmins, and self-hosters.

Today I’ll show you how you can run DNS changes in under 10 minutes, reducing any potential downtime to an manageable period. This method works on many shared hosting providers too, you don’t need any special or paid tooling.

Good to know:

Effortless Website Hosting on a Budget with Namecheap

Discover how to effortlessly host your website on a small budget with Namecheap's shared hosting. Explore the process from selecting a plan to configuring SSL, and learn to upload your site for a seamless online presence.

Rapid fast DNS changes #

To run rapid fast DNS changes, you need some preparation. It’s a three-step process which leverages temporary reduced TTL to work around DNS caching.

  1. 2 days before your planned migration date / time (T), you need to reduce the TTL down to 600 seconds for the DNS entry you want to update.
  2. At planned date / time of your migration, change the DNS entry.
  3. 10 minutes later you should ensure everything is working as expected.
  4. One day later you can re-set TTL to it’s previous value (most likely 86400 seconds).
timeline T -2 days : Reduce TTL to 600 seconds T : Run DNS update T +10 minutes : DNS change is propagated : Ensure system running T +1 day : Reset TTL to previous value

Disclaimer: Minimum TTL #

Each DNS cache can enforce a minimum TTL. That means, instead of 600 seconds you can also go with 60 seconds but it is possible that this value is set to some higher value, depending on the configuration of the DNS cache.

As far as I know the major DNS caches enforce 5 or 10 minutes TTL. So you should be safe following this article.

Oliver Lippert
Author
Oliver Lippert
I pay attention to the details. I think deeply about the purpose of functions, the clarity of variable names, and the importance of commit messages. Long-term thinking is crucial. Writing code is straightforward, but projects become more challenging as they grow. With over 15 years of experience, I’ve gained insights that I apply in coding, code reviews and business discussions.