Pular para o conteúdo principal

How To Flush The DNS Cache In Windows

How To Flush The DNS Cache In Windows: "

The Microsoft Windows operating system stores all DNS look-ups in a cache to speed up the connection for future visits to previously visited websites or servers. DNS for simplifications sake turns domain names like ghacks.net into IP addresses like 96.30.22.116. To simplify it further: computer users make almost exclusive use of domain names, while computers and devices of IP addresses.

The DNS provider is queried during each connection attempt unless the information are already stored in the cache.

You may want to know why someone would want to flush the DNS cache? Lets say you have decided to switch from your provider’s DNS server to Open DNS, Google DNS or another free service that promise faster speeds and little extras like user-configured site filtering. If you switch during a session, you will be using old data from the cache if you access sites that you have already visited.

Not a big problem? You may be right, but think about the following situation. A webmaster migrates the website to a new server. It can take up to 48 hours before all DNS servers redirect users to the website on the new server and not the old server. Some webmasters change their DNS server before migrating if the ISP’s DNS server is known to be on the slow site when it comes to updating information (another option for webmasters is to edit the hosts file).

The DNS cache can have privacy implications as well, especially on public computer systems or multi-user systems. It is possible to display the contents of the cache, which in turn reveals all the websites that have been visited by the user in the session. Flushing the cache removes the entries so that the next user won’t be able to see a list of visited websites.

Flushing the DNS Cache

On to the commands. Windows users need to open a command prompt to flush the DNS cache. The easiest way to do that is to press Windows-r, type cmd, and hit the enter key.

The command ipconfig /flushdns clears the DNS cache. All records up to this point in time are removed from the cache.

C:\Users\Martin>ipconfig /flushdns
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.

ipconfig flushdns

Displaying the DNS Cache

You can test if the DNS cache has been flushed with the command ipconfig /displaydns. Please note that the command may still display entries, but those are new entries that have been added to the cache after it has been flushed. Antivirus software may for instance connect automatically to update servers.

C:\Users\Martin>ipconfig /displaydns
Windows IP Configuration

ipconfig displaydns

Turning Off DNS Caching

DNS caching can be turned off for a session or completely. The negative effects are that look-ups may take longer, especially in computer networks with connected network shares and devices. Computer workstations without network connections on the other hand are likely not negatively effected by the operation. It is probably best to experiment with the setting first, by disabling it temporarily for a session.

The command to stop the DNS Cache for the active session is net stop dnscache. Please note that you need administrative privileges to run the command successfully. Windows 7 users can do that by clicking on the start menu orb, selecting All Programs > Accessories, right-clicking on Command Prompt and selecting Run as Administrator. The path should be similar for other versions of Windows.

c:\windows\system32>net stop dnscache
The DNS Client service is stopping
The DNS Client service was stopped successfully.

stop dns client service

You can start the DNS client service again with the command net start dnscache.

The previous instructions turned off the DNS cache for a single session. A restart would load it as a service again. It is however possible to turn off the DNS cache completely. This is done with the shortcut Windows-r, typing services.msc and hitting enter.

Locate the service DNS Client in the listing and double-click it. The window that opens offers controls to stop the service for the current session, and to change its startup type from manual to disabled.

dns client service

Disabled means that it won’t be started with Windows, which effectively disables the DNS Cache permanently. Another benefit of this is that other users are not able to display the DNS cache to retrieve a list of visited websites and servers.

Windows users who are thinking about disabling the DNS Cache permanently should test it first by disabling the cache for the session. If they do not notice performance drops or slower than usual connections they could go ahead and disable the cache completely.


© Martin Brinkmann for gHacks Technology News, 2011. | Permalink | Add to del.icio.us, digg, facebook, reddit, twitter
Post tags: , , ,

"

Comentários

Postagens mais visitadas deste blog

Favigen, Favicon Generator

Favigen, Favicon Generator : " Favicons are small icons that help identify websites. They are used as a visual representation of a website both in the web browser and at many online services. The three most prominent locations of favicons are the browser’s address bar, the tabbar and the bookmarks folder. Many webmasters like to create custom favicons to add that custom identifier to their website. Favicons can be created in many image and icon editors, but also online. Favigen is a straightforward favicon generator that can turn an image into a favicon. All that it takes is to pick an image from the local hard drive first, select the dimensions of the favicon and click the submit button to make the service generate the favicon. Favigen supports several image formats, including jpg and png, and it does not seem to have size restrictions either. Available image dimensions range are 16×16, 32×32 and 64×64. The generated favicon is displayed directly on the page. A click on do...

A simple rsync script to back up your home directory

A simple rsync script to back up your home directory : " Backing up important data is obviously something we should all do. Unfortunately, it is not always easy to make it happen. We get lazy; we do not have the additional hardware for a backup server; it takes a long time and a lot of CDs to back up to optical media; we do not trust online backup services; backup schemes are difficult to set up and use — any of dozens of reasons can stand in our way. Still, we know we should be backing up our important data. Modern open source Unix-like operating systems offer a plethora of options for incredibly simple, effective backup schemes, however. If the problem is figuring out how to set one up, a simple rsync solution may be exactly what you need. The rsync utility is used to synchronize files between two systems. It does so by way of incremental copies, only copying from the source to the destination what has not already been copied there, saving time, network bandwidth, and syst...

Google Wave now open to the public: faster, Robots and Gadgets aplenty!

Google Wave now open to the public: faster, Robots and Gadgets aplenty! : " Filed under: Internet , Google If you somehow missed it, Google Wave is now a bonafide Labs project: rather than being an invite-only alpha, it's now a public beta test! If you don't already have an account, just head on over to Wave and use your regular Google login details. If you've not seen any of the Google Wave introductory videos , you should check them out -- they explain the whole thing a lot more succinctly than I ever could. Wave has also been enabled for Google Apps domains -- businesses could convert their internal communication to Waves today! Leading up to this public release there have a lot of changes. It's by no means finished, but Google Wave is now a lot faster . It's also more intuitive -- more useful -- and given the large number of Robots and Gadgets now reaching prime-time readiness, it feels like the mass adoption of Wave is imminent. Also, if you're an ol...