How To Clear DNS Cache (Win / Mac / Linux)

The Domain Name System (DNS) is a software database program used on the internet to track the easily remembered names of host computers (domain names) to their respective Internet Protocol (IP) numbers. The DNS cache acts like a telephone directory for the Internet by translating human – friendly computer host names into IP addresses.

At times, when unauthorized domain names or IP addresses are inserted into the DNS cache, it is said to be corrupted. When computer viruses or other attacks insert invalid entries that lead to clients being redirected to malicious Web sites or other Internet servers a DNS cache corruption is reported.

How do we know if the DNS cache is corrupted?

In a situation when there are continuous alerts regarding DNS errors while trying to browse any site but it is available on another computer on the same network is known as DNS cache poisoned. The DNS cache has to be reloaded for that particular system. We will try to cover the various methods to clear your DNS cache in Microsoft Windows, Linux and Mac Operating systems.

To clear/flush DNS cache in Microsoft Windows

Press Start button >> Select Run >> type cmd and press enter.

In command prompt, type

C:\> ipconfig /flushdns

How to clear DNS Cache - Windows


In command prompt, type

C:\> net stop dnscache

C:\> net start dnscache

This will clear your DNS cache in Windows

To clear/flush the DNS cache in Linux

You need to restart the nscd daemon. You need login into the shell of your machine and type

root@support [~]# cd /etc/rc.d/init.d

root@support [/etc/rc.d/init.d]# ./nscd restart


This will clear your DNS cache in Linux Operating Systems

To clear/flush the DNS cache in Mac OS

In your terminal, type

For Tiger (10.4)

$ lookupd –flushcache

For Leopard/Snow Leopard Mac

$ dscacheutil –flushcache

This will clear your DNS cache in the mac OS.

If you are clearing your cache related to a browser, make sure is also cleared separately as clearing the DNS cache will not clear your browser cache. For clearing the browser cache, the settings will depend on your browser. Usually you will find the option to do so in Tools > Options in the menu.

Image source – VladStudio

Anand S

A techie who loves keeping track of the latest and the greatest in the industry.