Friday, December 2, 2011

End-User Knowledge: The DNS Flush

It happens a lot of the time:  Why can't I reach this website? Why is this site timing-out? How come this service isn't working?  It's frustrating to pinpoint why issues like this occur, but they often happen.  

The first thing you should always do when you have a computer issue is, don't panic.
Else you'll have this on your hands.

Anyways, what the DNS flush can do for you is clear away a pretty big mess.  It'll clear away any preset DNS entries in your system and provide default access to the sites/services you are trying to reach.

Quick Review:  
What is DNS?
DNS - Domain Name System

Devices on a network are identified by an IP address.  As users, you care not what an IP address is, but what that IP address is mapped to.  This is where DNS comes into play.  When you first type in an address to reach a website: (ex) http://www.google.com, typing in that address is called a DNS request.  

Basically, your computer is asking the world wide web, "hey, does anyone know a google.com?"  
Well, a DNS server essentially acts like a operator, it'll reply, "I found it and google.com is '74.125.225.84'"  Your computer completes the request, goes to 74.125.225.84, and you're on google.com. 

Your computer remembers this information in case you'd like to access the same site again, called DNS caching.  Typically, there is a certain length of time until your computer 'forgets' this mapping, however, it'll make a DNS request if it has forgotten.  

Back on point, sometimes that DNS cache or address memory bank gets corrupt or it's contents are affected by an application or service.  As a user, you'd notice an issue if you know for a fact you have an internet connection, but certain websites and services cannot load.  Here's where the DNS Flush comes into play.

In a Windows Command Prompt, that looks like this:
[C:\] ipconfig /flushdns
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.
[C:\]

This simple command clears your DNS cache and prompts the computer to make a DNS request, thus providing your computer with a proper address which will resolve to the website you were trying to reach.

I'm not going to get into specifics with this post or begin to discuss DNS hierarchy, but this should give you a better idea as to what the DNS flush does for you.  

Lastly, I'd like to point out that rebooting your computer clears out the DNS.  So, while it's annoying that your IT Support Tech will tell you to reboot, it serves a bigger purpose which will likely correct the issue.