Reading Time: 2 minutes

If your computer has trouble reaching a certain website or server this may be due to a corrupt local DNS cache. This guide will show you how to clear your local DNS cache (“flush” it) for several operating systems.


  1. First, open an elevated command prompt:
    • In Windows 8 and higher, use the keyboard shortcut Windows key + x to access the Power Users menu, then select Command Prompt (Admin).
    • In previous Windows versions:
      1. Type “command” into the search field at the bottom of the Start menu.
      2. Right-click on the cmd.exe icon.
      3. Select Run as Administrator.
  2. Enter the following command and press the Enter key on your keyboard:ipconfig /flushdns
  3. If all goes well, which it should, you will see the following confirmation message:Successfully flushed the DNS Resolver Cache.

Mac OS X

Launch Terminal and enter the appropriate command for your version of OS X, followed by the Enter key on your keyboard:

  • Mac OS X versions 10.10.4 and newer:dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • Mac OS X versions 10.10-10.10.3:sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches
  • Mac OS X versions 10.9:sudo killall -HUP mDNSResponder
  • Mac OS X versions 10.6-10.8:sudo dscacheutil -flushcache


Many current Linux distributions do not utilize a local DNS resolver cache like Windows and Mac OS X. If you do not know whether your Linux installation is utilizing local DNS caching, please see the website for your Linux distribution and look for information regarding default included software.

  • One of the most commonly used DNS caching Linux applications is NSCD (Name Service Caching Daemon). If you have NSCD installed, you can clear the local DNS cache by running one of the following commands in your favorite terminal/shell application:
    • To clear local DNS cache for current user:nscd -i hosts
    • To clear local DNS cache for all users:nscd -I hosts
  • Some Ubuntu and Debian-derived distributions can flush the cache with:sudo service dns-clean restart

Please see the related articles section below for more information on how you can modify your local hosts file, update DNS records, and learn more about the theory behind DNS.

About the Author: Jay Allen

Latest Articles

How to Install, Enable, and Configure Webmin on Ubuntu 20.04

Read Article

How to Set Up a Cron Job in cPanel

Read Article

What Is Puppet Software and How Do You Use It?

Read Article

Accessing Man Pages on Ubuntu 16.04 LTS

Read Article

What is VMware Fusion?

Read Article