Stop and Start Windows DNS Cache, when “ipconfig /flushdns” not working

When changing domain name server, I often get 404 not found page or still viewing the site content from previous server. Sometimes it will resolve after few hour, but sometimes need several days. All tutorial I found just mention to flushdns using windows command prompt. But It’s not Working.

This is how I solve the issue.

Follow this step to fix DNS cache problem in Windows


1. Open command prompt (cmd.exe)

You need to open this as Administrator. Right Click cmd.exe and select “Run as Administrator”, and follow the next step.

2. Flush DNS

type this in windows command prompt:

  1. ipconfig /flushdns

Press Enter, And you’ll see the result notice:

  1. Windows IP Configuration
  2. Successfully flushed the DNS ResolverCache.

3. Stop Windows DNS Cache service

this command will stop windows dnscache  service

  1. net stop dnscache

Press Enter, And you’ll see the result notice:

  1. The DNS Client service is stopping.
  2. The DNS Client service was stopped successfully.

4. Visit your site/domain

hopefully it’s already connected to the right IP/server/host. If it’s successful we need to start the DNS cache back.

5. Start Windows DNS Cache service

  1. net start dnscache

Press Enter, And you’ll see the result notice:

  1. The DNS Client service is starting.
  2. The DNS Client service was started successfully.

6. Flush DNS again

maybe this is not needed, but I usually just flush dns again (repeat step 2 above).

Other solutions

If it’s stil not working, maybe your browser DNS cache setting is the one need to be tweaked.

In Chrome browser, you can visit: “chrome://net-internals/#dns”(type it in browser url) and press the “Clear host cache” button.

If using Firefox you can type  “about:config” click “I’ll be careful, I promise!” button, and search for “network.dnsCacheExpirationGracePeriod“, change the vaue to “0” (zero), refresh the browser(maybe better to restart browser) and after DNS cleared, set it back to original value “2592000“.

Maybe Solutions

Use this on your own risk, but if all cannot solve dns problem, you can try to “Repair/Reset Winsock” settings using this command:

  1. netsh winsock reset catalog

This will reset the catalog and you’ll need to restart your computer.

How to check/see the data saved in DNS Cache

You can type this command:

  1. ipconfig /displaydns


All commands together:

ipconfig /flushdns
net stop dnscache
net start dnscache
netsh winsock reset catalog
ipconfig /displaydns


Original post: