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

Improve Windows Security By Closing Open Ports

Improve Windows Security By Closing Open Ports : " A standard Windows operating system has a number of ports open after installation. Some of these ports are needed for the system to function properly while others might not. These ports can pose a security risk as every open port on a system might be an entry point for a malicious user. A port basically allows communication to or from the device. Characteristics are a port number, an IP address and a protocol type. This article will give you the tools at hand to identify and evaluate the open ports on your Windows system to make a decision in the end whether they can or should be closed or left open. Software programs and tools that we will use: CurrPorts : Available for 32-bit and 64-bit editions of Windows. It is a port monitor that displays all open ports on a computer system. We will use it to identify the ports and the programs that are using them. Windows Task Manager: Also used to identify the programs and link some p

Diagnosing a Blue Screen of Death Error in Windows

Diagnosing a Blue Screen of Death Error in Windows : For many years now the famous Blue Screen of Death (BSoD) has been the ultimate indication that something disastrous has happened to make your computer die, but how useful is the information in the BSoD and the respective crash dump file that Windows produces? The best article I ever found explaining the BSoD in depth is here on the Microsoft website, however it’s quite technical and doesn’t discuss how to actually troubleshoot a problem. The crash dump file is just technical details of what was being held in the computer’s memory at the time of the crash, and this will include details on every driver and service that was loaded, and every piece of software that was running. The most useful pieces of information are to be found on the BSoD itself and are highlighted on the screenshot below. These are the BSoD error name, the stop error code and the name of the driver or service that has failed (this last one might not always appea

FBackup is a simple, no-frills free backup application

FBackup is a simple, no-frills free backup application : "