How to clear DNS on Windows PCs

Follow

When working with websites, a lot of the time you will need to have control over your DNS.
DNS makes use of a performance enhancement called caching. This caching is great for regular use, but can be a pain if you need to bypass it.

To see the DNS caching system for yourself:

Open up a command prompt as administrator
You can open command prompt by typing cmd in the start search box or by holding the Windows key + press 'R', type cmd and enter
Type ipconfig /displaydnsUnless the PC hasn't been anywhere yet, it will have LOTS of records. Here is one example of when I visited the server sharedcp-1-5.servercontrol.com.au
Notice the TTL (time to live) of the record - That's how many seconds until that entry is removed from the cache.


Here are two ways to deal with it:

1. Flushing the DNS cache

In an administrator command prompt, type ipconfig /flushdns

2. Turn off DNS caching

In an administrator command prompt, type net stop dnscacheNote: The DNS caching service will start again by itself. In order to keep the change, you'll need to set the service to manual start. This can be done using the command sc config dnscache start= demand
Once finished, you'll want to set it to = auto

Have more questions? Submit a request

Comments

Powered by Zendesk