How To Clear Your Computer’s DNS Cache

The Domain Name System (DNS) translates Internet domains into IP addresses. DNS is the component of the Internet which converts human-readable domain names (such as example.com) into computer-readable IP addresses (such as 192.0.32.10).

DNS cache stores the locations (IP addresses) of pages you have recently viewed. This is useful as it helps to speeds up the look up process but sometimes we want to clear the cache to renew the cache entries.

 Microsoft Windows:

  1. Click on Start, followed by All Programs, and then Accessories.
  2. Right-click on Command Prompt and choose Run as Administrator.
  3. In the Command Prompt window type in the following and press Enter: ipconfig /flushdns
  4. If all goes well, which it should, you will see the following confirmation message: Successfully flushed the DNS Resolver Cache.

Mac OS X 10.5.2 and above

  1. Click on the Finder icon in your dock. Open your Applications folder.
  2. Inside the Applications folder, click on Utilities and then Terminal.
  3. Type the following command in the Terminal window and press Enter: dscacheutil -flushcache
  4. Do not be alarmed if you do not receive any kind of response from the Terminal window after running the command. This is normal.

Mac OS X 10.5.1 and below

  1. Click on the Finder icon in your dock. Open your Applications folder.
  2. Inside the Applications folder, click on Utilities and then Terminal.
  3. Type the following command in the Terminal window and press Enter: lookupd -flushcache

Linux

Many current Linux distributions do not utilize a local DNS resolver cache like Windows and Mac OS X.

If you do not know if 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 Cachine 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: nscd -i hosts – Clear local DNS cache for current user. Also nscd -I hosts – Clear local DNS cache for all users.