You might encounter the term DNS propagation when you’re about to change information on your Domain name server (DNS).
In this article, I’ll explain what DNS is, how it works, and what DNS propagation is. I’ll also give instructions on how to flush your DNS cache and enhance your DNS security.
One way you can enhance security is by using a secure web hosting provider like Hostinger hosting.
What Is a DNS?
DNS (Domain Name System) is a directory of every domain name, and it’s used to access websites all over the internet. DNS translates the domain name or Uniform Resource Locators (URLs) and turns them into Internet Protocol (IP) addresses.
Because remembering the IP addresses of websites is such a hassle, DNS does all the work for you by matching the domain name with IP addresses.
What Is DNS Lookup?
DNS Lookup happens behind the scenes the moment someone enters your domain name into their web browser. After they hit the enter key, their web browser will then search for the location of your website. The DNS files of your website contain that information in the form of nameservers and IP addresses.
Once a user enters the URL into the browser, the browser will check the local cache. If the browser finds any information about your website, it will then open a session with the server hosting your site. The server will then send the website content. The browser then receives and opens the website.
If the information is not found in the local cache, the browser requests DNS information from the internet service provider (ISP). The ISP hardware will then check its cache. If the info is found, it will send them to the browser, and the browser will open a session.
If the information is still not found from the ISP, it will request info from the DNS server. The server asks the root server to find the information. Once found, the root server forwards it to the ISP and then to the browser.
What Is DNS Propagation?
DNS Propagation is the amount of time it takes when you change your website’s DNS, such as changing a hosting provider. DNS Propagation can take 72 hours to finish, but it will usually be finished within a few hours. It all depends on these factors:
- Time to Live (TTL) settings – This setting decides how long DNS information can be stored on a computer or DNS server.
- Internet service providers – ISPs tend to keep DNS information cached to load the pages faster for their customers.
- Domain name registrars – Any DNS change is sent to your domain registrar. Sometimes they don’t publish the changes immediately.
It’s important to note that DNS propagation is considered complete when all your site’s DNS records are updated on the internet. That’s why the process will take longer, for example, if you have a website in India but is hosted in the USA.
whatsmydns.net is a handy tool that helps check whether your DNS is still propagating or has finished.
How to Flush Your DNS Cache
Your browser and computer will often keep the IP addresses of the websites you’ve visited in the past. Outdated IP addresses can cause an error on the webpage called the DNS_PROBE_FINISHED_NXDOMAIN. Luckily, you can quickly solve this problem by flushing your DNS cache, so it is renewed.
- Click on the Start button, then search for the Command Prompt. Once found, right-click on it and select the Run as administrator option.
- A new window will then appear, and you should input the following code: ipconfig/flushdns
- Once typed in, press Enter, and you’ve successfully flushed your DNS cache on Windows. Below is how it would look:
- Hit the F4 key and head to the terminal in the Launchpad’s search bar.
- If you’re using Mac OS Sierra, X El Capitan, X Mavericks, X Mountain Lion, or X Lion, key in the command to flush the DNS cache: sudo killall -HUP mDNSResponder
- If you’re using Mac OS X Yosemite, type the command: sudo discoveryutil udnsflushcaches
- If you’re using Mac OS X Snow Leopard, use the command: sudo dscacheutil -flushcache
- For Mac OS X Leopard and lower, type in the following command: sudo lookupd -flushcache
- Hit Enter and you’ve successfully flushed your DNS cache.
Ubuntu (Linux) doesn’t cache DNS files by default. However, if you’ve previously installed a DNS service like name service caching daemon (ncsd), then you can try flushing your DNS cache by following the steps below:
- Press the Ctrl+Alt+T buttons at the same time to open the terminal window.
- Type in the command below to flush the DNS cache files in the init.d subdirectory: sudo /etc/init.d/nscd restart
- Hit Enter and you’ve successfully flushed your DNS cache.
Now you might not need to flush all the DNS cache from your operating system (OS), but instead, you can first try it on your web browser. To do so using Google Chrome, here are the simple steps:
- Enter the following into the address bar: chrome://net-internals/#dns.
- Hit the Clear host cache button.
- You’ve successfully flushed your DNS cache.
When it comes to DNS security, you always need to be careful of Distributed Denial of Service (DDoS) attacks. They target DNS servers and try to overwhelm the system by flooding it with traffic so no one can access your website.
Luckily, you can do a few simple steps to minimize the risk of getting DDoS attacks. One of them is to ensure that you use a secure web hosting service.
The second one is to introduce multi-factor authentication (MFA). It significantly reduces the risk of unauthorized access because it adds an extra layer of security. The first layer would be your username and password. The second layer is utilizing an authentication app like Google Authenticator.
DNS propagation is a common process, especially when there’s a change in the DNS, like changing a hosting provider. It often takes a few hours.
If you encounter the DNS_PROBE_FINISHED_NXDOMAIN, it likely means that the DNS information has changed, so make sure to follow the steps so you can re-access the site. Remember that you should always enhance your DNS security to avoid malicious attacks like DDoS.