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:

ipconfig /flushdns

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

Windows IP Configuration
Successfully flushed the DNS Resolver Cache.

3. Stop Windows DNS Cache service

this command will stop windows dnscache  service

net stop dnscache

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

The DNS Client service is stopping.
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

net start dnscache

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

The DNS Client service is starting.
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:

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:

ipconfig /displaydns

Further Reading

  1. How to Disable Client-Side DNS Caching in Windows XP and Windows Server 2003
  2. Repair/Reset Winsock settings

4 Comments

  1. Guy

    The latest update of Microsoft Windows 10 Home don’t allow the stoping or disabling of dns service, some users report that Windows Store need the service on to work too, poor thing.

  2. Sudesh

    No longer works in Windows 10 version 1809. DNSCache service now cannot be stopped even by administrator.

Comments are closed.