How to clear the DNS cache on your computer?

Castor 5 min read September 10, 2023 [Technology] #DNSCache #ComputerMaintenance #Networking

At times, it's essential to refresh the DNS cache on your computer, especially during website development or setup. This guide will walk you through the steps for clearing your DNS cache on various various operating systems and web browsers.

How to clear the DNS cache on your computer?

When you use your computer, it saves DNS information about websites you visit to make them load faster in the future. This usually helps speed up your internet experience. But if you're building a website or changing website settings, this stored information can sometimes cause problems. It might prevent you from seeing the latest changes you made to your site or even block you from accessing the right websites.

In order to refresh or clear your DNS cache, you should follow the specific steps that correspond to your computer's operating system or web browser. This essential process ensures that your computer or browser doesn't rely on outdated information when accessing websites. By refreshing the DNS cache, you enable your system to fetch the most up-to-date and accurate data from the internet, enhancing your overall online experience.

To delve further into this, let's explore the steps needed to clear the DNS cache for various operating systems and web browsers, ensuring you have the information you require to maintain a smooth and uninterrupted web experience.

Windows operating systems

To clear the DNS cache on Microsoft Windows, follow these steps:

CMD Option in Start Menu in Windows? CMD in Windows?
ipconfig /flushdns

Mac OS X operating systems

To clear the DNS cache on Apple Mac OS X, follow these steps:

Terminal in MacOS?

Linux operating systems

Unlike Windows and Mac computers, Linux systems don’t have a DNS cache by default. However, each distribution might use a different DNS service to store DNS records locally. Depending on the service, you can either clear the cache or restart the service.

Terminal in Linux?
sudo lsof -i :53 -S

The command will output all services listening to port 53 – the server port reserved for DNS. This way, you can see which is the DNS resolver your Linux is using in order to clear its DNS cache.

DNS Resolver in Linux?

As seen from the screenshot above, the service listening on the DNS port 53 is systemd-resolved. It could be dnsmasq, nscd or BIND as well.

Chrome and Chromium based browser

The Google Chrome and Chromium Based web browser maintains its own internal DNS cache. To clear it, follow these steps:

Remove DNS Cache in Google Chrome and Chrominum based browsers.

Firefox and Firefox based browser

Remove DNS Cache in Mozila Firefox and Firefox based browsers.
Chat on WhatsApp!