How to Flush Your DNS/Cache

August 15, 2011 / Updated: August 15, 2011 / Lena Shore
Filed under:

This is a quick tutorial primarily for web designers. Normally your DNS clients will automatically cache (store) IP addresses and other DNS results. This makes it quicker to retrieve information from the same host. However, sometimes your cache gets stuck while developing. For instance – you know you updated some information on your site and it is still showing the old information. How many times have you had to tell a customer to “refresh your page” when showing them web updates? Most of the time, refreshing your page or clearing your browser history/cache will fix this, but sometimes, it’s more stubborn and needs special treatment.

Mac OS X Flush DNS

If you are running Mac OS X 10.6 or newer:

  1. Launch your Terminal.
  2. Run the command “dscacheutil -flushcache”

If you are running Mac OS X 10.5.1 or below:

  1. Launch your Terminal.
  2. Run the command “lookupd -flushcache”

Linux Flush DNS

If you are running the nscd Name Service Cache Daemon:

  1. Open up a command terminal (either as root or run step 2 with sudo)
  2. Run the command “/etc/init.d/nscd restart”

Windows

Windows 98/NT/2000/XP Flush DNS:

  1. Open up a command prompt (Start > Run > “cmd.exe” > OK).
  2. Type in the command “ipconfig /flushdns”

Windows Vista / Windows 7 Flush DNS

  1. Click the start button and navigate to the command prompt (Start > All Programs > Accessories > Command Prompt)
  2. Make sure that you right click on the command prompt application and choose “Run as Administrator”
  3. Type in the command “ipconfig /flushdns”

 

Archives

Categories