Need to clear you machine’s DNS Cache? Running Microsoft Windows? It’s pretty simple and straight forward.
- Fire up a Command Prompt†
- Run the following command
You can also take a look at what’s in your DNS resolver cache with the following command
Why would you clear your cache?
Most DNS clients will cache the results of name resolution request to speed up multiple lookups to the same URL. Just think about how many requests are made to the same domain when visiting a single web page. Every file, image, style sheet, etc... that is on that page and served from the same domain requires a DNS lookup.
So if you have an invalid DNS entry cached on your local client you’ll need to flush it out of the cache so your client can do a new lookup and get the correct information. Or your other option is to wait until that DNS entry expires and the cache flushes it automatically... which typically takes about 24 hours.
Other OSes?
Not to hate on fans of other OSes out there - especially since I totally dig both Ubuntu and Mac OSX - here is how you clear the DNS client cache for both Linux and OSX.
In Mac OSX:
From a command (or terminal window... depending on where you come from) run this command
In Linux:
Updated based on comments from nop. The DNS cache is actually managed by the nscd daemon for Linux boxen, so you just need to restart the daemon. You can do that using this command
sudo /etc/init.d/networking restart