How to Flush Your DNS/Cache
August 15, 2011 / Updated: August 15, 2011 / Lena Shore
Filed under: General
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:
- Launch your Terminal.
- Run the command “dscacheutil -flushcache”
If you are running Mac OS X 10.5.1 or below:
- Launch your Terminal.
- Run the command “lookupd -flushcache”
Linux Flush DNS
If you are running the nscd Name Service Cache Daemon:
- Open up a command terminal (either as root or run step 2 with sudo)
- Run the command “/etc/init.d/nscd restart”
Windows
Windows 98/NT/2000/XP Flush DNS:
- Open up a command prompt (Start > Run > “cmd.exe” > OK).
- Type in the command “ipconfig /flushdns”
Windows Vista / Windows 7 Flush DNS
- Click the start button and navigate to the command prompt (Start > All Programs > Accessories > Command Prompt)
- Make sure that you right click on the command prompt application and choose “Run as Administrator”
- Type in the command “ipconfig /flushdns”