How to speed up DNS propagation and fix browser cache in 2023

For web developers

Fullstack CTO
4 min readMar 23, 2023

DNS propagation refers to the duration required for updates made to a domain’s DNS records to be implemented across the internet. When you modify a domain’s DNS configuration, the changes may not be instantly visible worldwide on the internet. This is because DNS records are cached on various servers globally, and these servers need time to refresh their records.

Why is DNS propagation significant?

As a casual internet user, DNS propagation might not be a pressing concern for you. However, if you manage a website or domain, it’s crucial to comprehend how DNS propagation functions, as it influences the speed at which your modifications become effective. For instance, when transferring a domain to a new web hosting provider, it’s vital to consider the length of the DNS propagation process to plan accordingly.

Without knowledge of DNS propagation, you may erroneously believe that your domain’s DNS settings updates take effect immediately, while in reality, it could require several hours or even longer for complete propagation throughout the internet. This misunderstanding may lead to confusion and potentially create issues for your website or domain.

How to propagate changes faster

Decrease TTL (Time-to-Live)

An effective strategy to expedite DNS propagation involves lowering the time-to-live (TTL) value for your DNS records. This informs DNS resolvers of the cache duration for your DNS records. By decreasing the TTL value, DNS resolvers will refresh your records more frequently, thereby accelerating the propagation process.

Nonetheless, there are some drawbacks:

  1. If your website’s DNS records expire rapidly, it may seem sluggish to visitors since their browsers need to fetch new records more often, which takes time. This can result in user frustration and a reduced likelihood of continued site usage.
  2. The number of requests sent to your DNS authoritative resolver may increase. If you manage your servers, this could add extra pressure on your system, potentially raising hosting expenses and server fees.

By planning in advance, you can circumvent these issues by temporarily lowering the TTL values of your DNS record one day before scheduled changes. This ensures that all records will expire promptly when desired.

For instance, if your DNS records have a TTL value of 1 day, you can adjust it to 5 minutes the day prior. The following day, you can modify the DNS records to direct to new servers. This guarantees that all new visitors will be routed to your new server within 5 minutes of implementing the changes. Once you confirm that everything functions as intended, you can restore the TTL value to 10 munutes.

Request DNS resolvers to flush cache

If you didn’t prepare in advance and need to update your DNS records urgently, you can ask DNS resolvers to clear cache values for your records and replace them with the current values. Here are the links for some major DNS providers:

While clearing the cache from these servers will update the records for most internet users, tech enthusiasts and enterprise clients who maintain their own DNS servers might still possess outdated copies of your DNS records until they expire.

Check world propagation

For developing only — change hosts file

Until the DNS is distributed correctly, you can continue to work on the site by writing the necessary IP addresses in the hosts file on your computer. This file is processed first, without requests to DNS servers. The hosts file can be found in the following locations depending on your operating system:

  • Windows: C:\Windows\System32\Drivers\etc\hosts
  • Linux: /etc/hosts
  • MacOS: /etc/hosts

How to flush your DNS cache on your computer

Microsoft Windows

The following command will work on Windows 7, 8, 10 + Windows Server, but opening the command prompt is slightly different for each version.

  1. Right click on the start menu and choose Command Prompt (Admin) from the menu.
  2. Type in the command ipconfig /flushdns

MacOS

  1. Open Finder and navigate to the Applications > Utilities directory and open the Terminal app.
  2. Type in the command sudo killall -HUP mDNSResponder.
  3. Enter your password when prompted.

There are more instructions here

DiG Command

If you’re familiar with the command line and prefer using a terminal over a third-party service, you’re in luck. The ‘dig’ tool is preinstalled in nearly all Linux distributions, allowing you to check records for any website with the following command:

dig geekjob.tech

You can also query the records from a particular nameserver instead of using the default DNS resolver by specifying the IP address of the server:

dig @1.1.1.1 geekjob.tech

How do I make Chrome use HTTP instead of HTTPS?

Chrome remembers sites that had HTTP Strict Transport Security headers:

Strict-Transport-Security “max-age=31536000; includeSubDomains

And it categorically refuses to switch to the HTTP protocol.

In this case go to the browser settings:

chrome://net-internals/#hsts

And delete the domain through section “Delete domain security policies”:

If you have any other options, please write in the comments. I’d be happy to learn something new.

--

--

Fullstack CTO
Fullstack CTO

Written by Fullstack CTO

CTO and co-founder at NEWHR & Geekjob

No responses yet