How to flush operating system DNS cache

Following is a process to flush DNS cache in Windows, Linux or Mac Machines. We will soon create another post on how to flush DNS cache in browsers.

Clear/Flush DNS cache in Microsoft Windows.
Firstly, you need to run the cmd.exe, and use either of the two commands to flush DNS cache:

C:\> ipconfig /flushdns

OR, in command prompt, type

C:\> net stop dnscache
C:\> net start dnscache

Once you run the command, your Window DNS cache will be cleared.

 

Flush the DNS cache in Linux
No matter you are running Redhat, Debian or related Linux systems, you can always use nscd daemon to flush OS dns cache. You may need to install the package nscd first.

root@admon # /etc/rc.d/init.d/nscd restart

Once you run the command your new DNS record will take effect immediately.

 

Clear DNS cache in Mac OS.
For Tiger Mac, in your terminal, type

$ lookupd -flushcache

For Leopard Mac, the command is:

$ dscacheutil -flushcache

flush dns in mac os
Once you run the command your DNS cache (in Mac OS) Clears.

Share Button

2 thoughts on “How to flush operating system DNS cache

  1. The Linux command line shown here is incomplete. “/etc/rc.d/init.d” is usually a directory. Neither a binary nor a script.

Leave a comment

Your email address will not be published. Required fields are marked *