Written by Tom White on . Posted in Servers

DNS stands for Domain Name System and DNS is used to translate human-readable names into IP addresses. The name sitepearl.com is much easier to remember than, so we use DNS to map IP addresses to domain names. In a sense, you can think of DNS as a massive decentralized phone book.

Name Servers

Just like we have web and mail servers, a server that hosts the DNS service is known as a name server.

When registering a domain at a domain registrar, one of the configurable options for the domain is the DNS servers that the domain looks for when data is requested from the domain. Most hosting provides and registrars will provide a few name servers for people to use, but more advanced users typically prefer to run their own servers. Anyone can create a DNS entry for any domain. What makes any one entry valid over all the others is which DNS server the domain is 'looking' at. A common naming convention for name servers is dns{n}.domain.com, such as dns1.sitepearl.com and dns2.sitepearl.com

Typically, websites will have at least two name servers assigned to them. Some setups will have as many as four DNS servers while some websites get away with just one. An advantage of having more than one name server is that the website will still be accessible so long as at least one of the name servers is online to tell your browser where the website is sitting at on the web. If dns1 is down, the browser will try to contact dns2, and so on. Of course, this only works properly if each DNS server has the most recent copy of the site's zone file.

Zone Files

A zone file contains all the different IP to hostname mappings for a domain as well as some meta information such as how long a DNS request can be cached before becoming invalid.

A single line from a zone file might look something like this:

sitepearl.com.  IN  A

Here, the hostname sitepearl.com is mapped to the IP address by with an A record (discussed below), so anytime the domain sitepearl.com is requested by a user, the computer will know that sitepearl.com is sitting on the IP

Record Types

Within a zone file, each line is considered a Resource Record. Each Resource record can be of a particular type for mapping and configuring different types of traffic. The most popular type of record by far is called an A record, and A records essentially map an IP address to a hostname. Specifically in regards to the Internet, domain names are the hostnames.

Another popular Record Type is the MX record, used for routing email. Larger organizations will have a different IP for their web and mail servers, so web traffic might be routed one place while mail traffic might go to another, but still show up as the same domain (such as @sitepearl.com). One example of this is the Google Apps for Work suite. It's a service where Google runs an email server for an organization, but email still shows up as @whateveryourdomainis.com instead of @gmail.com. MX records make this happen by routing all mail traffic to the organization's domain to the Google email servers.

DNS Caching

One of the most frustrating aspects of DNS is the concept of DNS caching. DNS caching refers to caching the DNS information for a particular domain for a fixed amount of time so your computer doesn't have to reach out the the domain's DNS server for every request. However, this can become problematic when the zone file on the server changes and the user doesn't get the updates. If the old server was taken offline, it may appear as if the website itself is down or if the old server was kept online, the user would never know they're pointing to the wrong IP address and could very well write data to an incorrect database, sowing the seeds of despair for some poor under-appreciated website administrator.

There are two primary levels of caching for most people: local and ISP. Your local DNS cache is pretty easy to clear. On Windows just open Command Prompt and run this command:

ipconfig /flushdns

This command will force your computer to get a fresh copy of the DNS information next time the domain is request from the computer, but the real trouble lies with the ISP caching. Serving thousands of customers the same domain daily, it is common practice for ISPs (Comcast, Charter, ATT) to also cache DNS information so they don't have to request the same information over and over again. So while you may have cleared the cache on your computer, it often won't help an issue related to a zone file being modified because your local cache is just going to grab a copy of the same data from the ISP. An ISP might cache DNS information anywhere from 15 minutes to 48 hours.

Built with HTML5 and CSS3
Copyright © 2014 Sitepearl