How to flush DNS cache in Windows from the command line |
Ever want or need to see the most recent version of a website? Maybe the DNS has changed and now you are still seeing the old version location cached while all your friends are seeing the new version. How do you flush those stale DNS records from your system?
That’s the command to remember: flushdns
Setting up Adsense for Domains on a few of our domains this week and had the need to flush the DNS on my Windows machine so I could see the domain ads that were showing. Kept hitting the search engine to find sites to remind me of the proper shell commands to use. It’s not like it’s super complicated to remember, but I try not to memorize commands I rarely use. Almost have it memorized now though and to help along the process I decided to make it a blog post here as well. What should these type of blog posts be called? Self-reminders? Whatever, let’s get to the flushing.
Step by step instructions for flushing the DNS cache in Windows
STEP 1. Go to START in the lower left corner and type:
STEP 2. right click on the cmd.exe under the Programs bar and in Windows Vista choose "Run as Administrator"
STEP 3. in the cmd.exe shell window type the following:
STEP 4. Reload the website you want to see the most recent version DNS retrieved. Wash, rinse, repeat as necessary.
Did this post make you go hmm?
Maybe Related Posts (plugin generated)
- How to identify and remove Wordpress comment spam MySQL queries
- How to access MySQL from Windows Command Prompt
- How to build a Google subscribed link for your about/bio page step by step
- How to check hard disk size in Linux from shell
- How to use speech to text dictation mode with the Tablet PC
- Unofficial GMail file system



(3 votes, average: 4.67 out of 5)
Help me out with this… i have been looking for a way to do what i think is explained here for ages.
When i change my link order for example i sometimes cannot actually view it and have to resort to using a different browser which is irritating.
This looks like a solution but, I have an auto translator on my site with a caching module and WP-Supercache running so I need the pages to be cached for the translated versions so i dont keep querying the translation engine and eventually have my site blocked.
Is this “DNS flush” only affecting what is stored on my local machine? If so then it the solution to a huge hinderance! but I wont do anything until I have a definite answer as I don’t want to delete any cached pages on my site.
Comment by Andy in Tenerife — December 31, 2008 @ 7:12 pm PST
Hi Andy,
If I’m understanding you correctly flushing your DNS will not help you. All that flushing your DNS does is return the most recent DSN information for a website. You aren’t changing the content of what the server of a site the DNS points to already. A cache is usually purged for all visitors after a certain number of seconds, so no matter how many times you visit until that number of seconds has passed a new page will not be delivered.
Short answer: no, this will not help. What would help is to reduce the number of seconds that you are caching pages or to purge the cache for a particular page that you want to receive. Check the admin area in WP-supercache and look for the number of seconds variable and lower and/or purge the cache for only the page you are concerned about when you want a new page. Just reduce that seconds for pages to be cached to say once every five minutes. Then you’ll receive a fresh page every 5 minutes.
Caching programs are useful for heavy trafficked pages. This blog employs a cache and in some very heavily trafficked posts goes even futher than a cache by delivering a static page that only changes when a new one overwrites it. Caching is best to combat things like the slashdot effect, if you are familiar with that (if not: the slashdot effect is when a site/page gets linked by slashdot.org and a massive amount of visitors come to the site at one time possibly overloading your web server).
Hope this explanation helps
Comment by TDavid — December 31, 2008 @ 9:40 pm PST