Deprecated: Function create_function() is deprecated in /home2/blogwebhostingbu/public_html/wp-content/plugins/facebook-like-box-responsive/facebook-like-box.php on line 29
What Exactly is DNS and What Does It Do? - WebHostingBuzz US Blog
Notice: Undefined variable: defaults in /home2/blogwebhostingbu/public_html/wp-content/plugins/fatpanda-facebook-comments/plugin.php on line 366
 

What Exactly is DNS and What Does It Do?

Posted on 30 Mar 2009 by
Warning: printf(): Too few arguments in /home2/blogwebhostingbu/public_html/wp-content/themes/webhostingbuzz-blog/single.php on line 16

The Domain Name System (DNS) is an essential element of the Internet, responsible for tying a domain name to the IP address where that domain resides.  Since humans can only memorize so many twelve digit IP addresses (for example: 127.243.238.123), DNS was created as a way to take that IP address and create a unique human-identifiable name to be related with it.  Because of DNS, you can type “google.com” into your browser and it magically finds the Google server.

It comes in handy to thoroughly understand the DNS system because you use it constantly as a web developer or server owner, so let’s take a moment to see how this process works.

DNS Resolution

When you type “google.com” into your browser and hit enter, many things happen behind the scenes that you never see:

  1. The browser takes the name “google.com” and sends a DNS request to the default name server setup by either your IT staff or your ISP.  Basically, it asks “Where is google.com?”
  2. The default name server looks in its DNS table to find “google.com”.  If it has an entry for it, it sends back the corresponding IP address.  If it does not have an entry, it forwards the request to another DNS server – typically operated by your ISP.
  3. The next name server looks at its table, and hopefully has an entry for “google.com” and is able to respond with its IP address.  Although this process could repeat, it typically doesn’t exceed 1-3 forwards before it finds the correct entry.
  4. The browser receives the response saying Google’s IP address is “74.125.67.100” and then sends a request to 74.125.67.100 for the page you asked for.

See the Process in Action

If you are a Windows (XP/2000) user, click on Start, Run, and type “cmd” without the quotes, and hit enter.  

Windows Vista users need to find the command prompt in their Start Menu.

A command prompt should come up after you have done this.  From here, type “nslookup google.com”.  If you are connected to the internet and DNS is set up correctly, you will see something like this:

dnsinaction

As you can see in my case, my router acts as a DNS server (or it forwards the request to the ISP if it does not have any record of the domain I request.)  In this case, the ISP returns three addresses: 74.125.67.100, 74.125.45.100, and 209.85.171.100.  All three of these addresses can be used to get to Google if you type them into your web browser – the result would be the same as if you typed in “google.com”.

What Happens if DNS is Not Working Properly?

If DNS is not working, you can not access any domain by it’s domain name, but instead must use the server’s IP address.  How many server IP addresses do you have memorized?  Probably not many.

If you can visit most sites, but can not visit one of your own, it is possible that this is due to a DNS error.  A few times over the years, one of my domains have gone down in a fluke DNS problem from my ISP.  The way to test this is to ask a friend on a different ISP to try to visit your site.  If he can get through, it is likely you are experiencing DNS problems.

DNS “Propogation”

A myth among internet users is that DNS has to magically “propogate” from one server to another, populating all across the world, which can take hours.  In practice though, this is not true.  DNS uses a caching feature set by the DNS server which sets a timed cache on a DNS query.  This way, when you try to go to Google.com each time you open a tab in your browser, the computer does not have to go out and look for the IP address every time.  It stores a cache of these records for a predetermined period of time to save time the next time it has to find Google.com.

Name Servers

When you purchase a domain, you have to point your domain to name servers (NS) so DNS requests can find your web server’s IP address.  The NS is a record that points your domain to a particular DNS server that stores your records.

Types of DNS Records

The most common records you will find in DNS include:

  • “A” record – returns an IP v4 address (the location of the web server)
  • “CNAME” – returns the correct path for sub-domains
  • “MX” – returns the location of a mail server for that domain

A full list of DNS Record types can be found here.

WebHostingBuzz Logo

© WebHostingBuzz USA LLC 2002 - 2024
WebHostingBuzz is a Registered Trademark.
All Rights Reserved.
WebHostingBuzz USA LLC, 850 Southbridge Street, Auburn, MA 01501, USA

1 (800) 252-1887

Payment Logos
  • Webmoney Verified
  • Webmoney Accepted

Sign up for our Newsletter

Scroll to Top