Latest WordPress Tutorials

How to Clear DNS Cache From Chrome,Firefox and Safari

How to Clear DNS Cache From Chrome,Firefox and Safari
Written by Muhammad Fayyaz

Most people are not even familiar with DNS or Clear DNS cache because we don’t need to do it frequently. Sometimes, the real pain is having old DNS data into the cache, stopping us from accessing updated versions of websites. So it is essential to know how to clear DNS cache.

How does DNS Cache Works?

On the internet, every DNS corresponds to a specific IP address. If you want to know which IP addresses the website has behind the DNS, you can use the ping command or traceroute command.

Once the DNS grabs the server’s IP address, it stores it into the cache; DNS never checks for the IP address every time you visit a website. But it keeps that information into the local machine, and when you search for any website first, the system looks at its cache and, if not found. Then went on to grab new information.

It could be possible for a website to move to a new server or new IP address. If your cache has the old IP address against any DNS, it will bring the website’s old version. It even shows you an error that you can’t access the website.

It’s not that technical, but it is the most straightforward thing to do when you ask how to clear the DNS cache. In short, you can remove the DNS cache in just a few clicks and resolve the issue you are facing.

We will explain how to clear DNS cache from web browsers and operating systems like Windows, macOS, and Linux. Why and when do you need to remove the DNS cache.

What is Cache?

The cache is the small database that stores the recently visited files and saves their metadata. So whenever you access newly opened files again, cache memory helps to load that file faster and quickly. Your system and browsers both have a cache and store mini information. Browsers store the cache of the website you visit, and PC stores the cache of the recently opened files, so it helps to load those files and applications faster.

What is DNS Cache?

Before you know how to clear a DNS cache, you first need to understand what it is and what information it stores specifically. DNS is a Domain Name System, and DNS cache is like a directory and phone book for websites.

DNS Cache is the storage that stores the information of the recently visited IP addresses. So whenever you revisit a website, your browser doesn’t need to lookup for DNS again and again; it just recollects the information from the DNS cache and opens the website more quickly.

Every URL has a specific IP against it; for example, www.example.com will have an IP address like 192.168.0.0. So when we type and access www.example.com, we are trying to access that IP.

DNS cache can be sometimes corrupt, which leads you to face some problems while browsing. It can become outdated as well, so in this kind of situation, clearing the DNS cache is the best option to take you out of the problem.

What Information Does the DNS Cache Contain?

DNS cache is a small database that contains all the IP addresses of the websites you access. The essential purpose of this mini database is to make access to the website you frequently visit faster.

What is DNS Flushing?

Flushing means flushing out old data thoroughly. When we do DNS flushing, our system deletes all the existing information about the DNS names and IP addresses. After that, whenever you visit a website, your computer will bring new knowledge and IP addresses of the websites and store them in a DNS cache to improve the browsing experience.

Why DNS Cache Needs To Be Clear

Not just a single but multiple reasons are there to clear your DNS cache.

Maintain Secrecy of Search Behaviour:

Cookies store your information and the pattern of your internet browsing. Like which type of websites you visit, what information you have put on it, and your browser searches. Cookies are primarily used to track user behaviors online.

DNS cache also collects data that make visible your online behavior, and the hacker will spoof your browsing behavior. He will judge you based on the website you visit how much time you spend on it.

DNS Spoofing:

DNS is more than what you think can be used to compromise your security. Hackers can spoof your DNS cache and manipulate the website you visit; they can redirect you to the wrong websites and collect even your data.

Personal data could be of any of your login credentials and banking credentials. So it is a good practice that you clear your DNS from time to time.

Technical Issues:

Clearing DNS can resolve technical issues. Sometimes you visit a website, and your browser shows you an error that you can’t connect to this website or the website is not available.

These errors could be due to a change of the IP address of the website, the website’s IP could be updated, and your windows save an old IP address against a specific DNS, and when you try to access that website, your system access the old IP address where this DNS does not reside anymore.

So when you clear the old information of the DNS and access the website now, it will store the new IP address of the DNS in its cache.

How to Clear DNS Cache in Windows

Cleaning the DNS cache in the Windows operating system is quite simple. We will show you how to clear DNS cache on different versions of Windows,macOS, and Linux.

Windows 10

  • On Windows 10, DNS cache flushing can be done with three simple steps.
  • In Start Menu>Window System, look for the command prompt right click on it to open it with administrative privileges.
  • You will find Command Prompt in Windows System.

How to Clear DNS Cache From Chrome,Firefox and Safari

  • Or you can quickly type Command Prompt in the search option.
  • Now type this command ipconfig /flushdns.

how to clear DNS cache

  • This command will return a message of the DNS cache cleared successfully.

Window 8

In window 8, the process of clearing DNS is the same. You have to put the same command to clear the DNS cache. The only difference is access to the Command Prompt.

In Window 8, you have to go to the app screen from the start, and you can find Command Prompt here. Now run the same command of now typing this command “ipconfig /flushdns.” This command will return a message of the DNS cache cleared successfully.

Window 7

  • In window 7, you have access to the Command prompt by
  • Clicking on the start menu
  • Go to the folder of All programs>Accessories.
  • Click on Command Prompt
  • Run the same command “ipconfig /flushdns.”
  • This command will return a message of the DNS cache cleared successfully.

How to Clear DNS Cache in Mac OS

  • In Mac operating system, you need to perform commands on the terminal command-line interface of macOS.
  • On macOS’s 10.11 version of above, Click on Go in the upper navigation bar.
  • Now Click on Utilities and open the terminal.
  • Run the command “sudo killall –HUP mDNSResponder.”
  • Now the terminal will ask your computer password to execute this command.
  • Enter the computer password; your cache should be clear by now.

macOS Yosemite

In this version of the macOS, all processes are identical, but the command you have to type to clear DNS cache is different.

  • Open terminal and type this command
  • “Sudo discovery until udnsflushcaches.”
  • Enter the computer password; your cache should be clear by now.

macOS Snow Leopard

In this version of macOS, open Command Prompt and type the following command.

  • “Sudo dscacheutil –flushcache.”
  • Enter the computer password; your cache should be clear by now.

Linux

In any Linux distribution, clearing the DNS cache is as simple as in any other operating system.

  • If you are using any distribution of the Linux other than Ubuntu, you can type the following command in the terminal (Linux also use the terminal as its Command-line interface)
  • “sudo/etc/init.d/dns-clean start”
  • Now enter the computer password if asked; your cache should be clear by now.

On Ubuntu

You need to open the terminal from the desktop and type the following command.

  • “Sudo systemd-resolve –flush caches.”
  • Now enter the computer password if asked; your cache should be clear by now.

Clear DNS cache from Browsers

Clearing DNS cache from different browsers follows different steps. We will explain how to clear DNS cache from browsers.

Chrome:

Open Chrome

  • In the address bar, type chrome://net-internals/#dns.
  • A setting page will open, and you will see options in the left pane.
  • Click on DNS from the options.
  • Clear host cache option will appear; click on this button.

How to Clear DNS Cache From Chrome,Firefox and Safari

  • This process will clear the DNS cache.
  • You have to restart Chrome; then, changes will take effect.

Opera

  • In opera, you have to perform almost the same steps with just a little bit of difference.
  •  Open Opera on your PC.
  • In the address bar type opera://net-internals/#dns, press enter.
  • It opens the opera’s DNS setting page.
  • Click on the Clear host cache button.

How to Clear DNS Cache From Chrome,Firefox and Safari

  • In the left menu, you will also find settings for the socket; click on it.
  • Now click on the button Clear Socket Pools.

How to Clear DNS Cache From Chrome,Firefox and Safari

  • Restart Opera. Your DNS cache and socket cache have been cleared.

Firefox

  • Open Firefox in windows.
  • Type about : config in the URL address in Firefox, press enter.
  • Now click on the warning “I accept the risk.”

How to Clear DNS Cache From Chrome,Firefox and Safari

  • Use search bar to search for option “network.dnsCacheExpiration”
  • It will return two variables, “network.dnsCacheExpiration” and “network.dnsCacheExpirationGracePeriod”.

How to Clear DNS Cache From Chrome,Firefox and Safari

  • Change their values by editing both the variables from 60 to 0. It will prompt Firefox to clear the DNS cache.
  • Now again, set the values of variables to 60.

How to Clear DNS Cache From Chrome,Firefox and Safari

  • Restart Firefox

Safari

  • Launch Safari on Mac
  • In the Safari menu, click on preferences and choose the hidden development option.
  • Click on the advance tab, now check the box of option “show develop menu in the menu bar.”
  • Now new option in the menu bar will appear.
  • Click on develop from the menu and select the empty caches option.
  • After clearing the cache, restart the Safari browser.

Conclusion

Clearing DNS cache as it sounds is not a complicated process; it’s a pretty simple steps process. If you are not familiar with troubleshooting in any way, you will find it a little bit difficult.

You need to have information on what operating system you are using or which browser you are using. The steps are straightforward in our tutorial, making it easy for everyone to clear the DNS cache.

About the author

Muhammad Fayyaz

Muhammad Fayyaz is an award-winning Top Rated Freelancer on Fiverr.com and upwork.com. He's developed more than 1500 websites. Served more than 900 clients all over the world with 5-star ratings. Fayyaz is a highly skilled WordPress Developer and Digital Marketer with over 8 years of experience. He has a strong background in web development and is proficient in various programming languages. In addition to his online marketing skills, Fayyaz is also an expert in digital marketing, with a deep understanding of SEO, social media, email marketing, and lead generation. He's worked as a Technical Support Engineer for over two years. Fayyaz wants to give back to society, so he's created this blog to share his knowledge and help new comers.

Leave a Comment

15 − eleven =