Understand the Domain Name System (DNS)
Posted by Corey Smith on Feb 3, 2015, 7:20:00 PM
DNS stands for the Domain Name System. The DNS records tell the internet where to send your internet traffic. The most common (that I will discuss later) are address (A) records, CNAME records, name server (NS) records and mail exchange (MX) records.
Many web developers simply tell their clients to point the Name Server Record to the new host and you let the web developer manage that for you.
So, what does this mean for you? How do you know what you should do to maintain functionality of your site and your email? Bear in mind that my descriptions below are what I tell my my clients, but I think everyone should understand these details.
Where are the DNS records hosted?
In order for the internet to know where to send traffic, your DNS records must be hosted somewhere. There are three primary ways your DNS records can be hosted.
At your Domain Registrar
Where ever you buy the domain is your domain registrar. If you leave the Name Server Records (explained later) at your registrar, you can have complete access to your records when you need to and can fire your web hosting company any time without even having to contact them. I recommend GoDaddy.com. I think their advertising is obnoxious but their service and online interface is good and their telelphone service is not so bad.
At a Third Party DNS Location
This is a good alternative to your Domain Registrar. You have the same level of access (usually). If you have full access to your records, you should be fine managing this way. There are some risks with some DNS hosting services, but it may be a viable option for you. In some cases, this may cost you a small fee. This is how Tribute Media manages our DNS. Cloudflare is a good example of a company that provides additional services but require that you use their name servers.
At Your Web Hosting Company
If you use a reputable Domain Registrar then this should never be a concern. There are some valid reasons why this can be a recommended choice.
What are all those records?
There are a lot of different types of records that exist for the internet. There are only a couple that you need to worry about when managing your website. If you can't sleep one night, you can look at Wikipedia for a complete list of DNS record types. However, here is a simplified way to look at the important records that most people should be concerned about.
Address Record (A)
All websites use an IP address to be identified on the internet. An A record tells the internet what ip address the internet should associate with the name. For example, the IP address for this site is at http://22.214.171.1241/ but since that is not an easy number to remember and because of the IT magic some servers like our do so you can't really see it that way, the A record tells the internet that when you type in http://www.TributeMedia.com the IP address will be automatically identified. Click on both and you will notice that you end up in the same place.
If you are setting up your domain name to resolve to the right IP address, the A record will point to your main domain is "@". If you are setting up a subdomain for anything, you would simply create an "A" record with the subdomain name. You can have a different site at http://files.example.com. In that case, you would create an A record called "files" pointing to the appropriate IP address and make sure that the subdomain is configured on your web server.
A CNAME will point to an A record or another website. The most common use (although there are many) is used to point the subdomain of www to your domain. If you want http://www.example.com to point to http://example.com, you would usually create a CNAME called “www” (without the quotes) and point it to your "@" A record.
Name Server Record (NS)
The NS record tells the internet what server is holding all the records. I ask my clients never to change this. If you do change this, all of the other records on your old Name Server become invalidated. If you had any custom records installed, they will become no more.
Mail Exchange Records (MX)
You need to have email and the MX records tell the internet where to direct that email. You may have email hosted at your office on an Exchange Server, you may have your email hosted as a Google App or you may have other email arrangements (like with your registrar). The MX records direct traffic to the right email servers. You can change your website hosting without affecting your email if you have control over all the DNS records in one location.
How Do You Apply This Information?
Hopefully this wasn't too overwhelming. When you are making your website live or your are changing some email settings to route traffic, the person helping you will tell you what settings to change. If someone asks you to change your Name Servers, I would seriously question the reason they ask because that may mean that you will lose a bit of control on how you can manage everything. When setting up your DNS records for a site that we host for you, you’ll only need to change two records (if it is different, we’ll tell you. The two records you’ll change is the “@” A record (you’ll put in the IP address we give you). The second is that you’ll make sure there is a CNAME record call “www” (without the quotes) pointed to your “@” A record.
A Note about Shared versus Dedicated Hosting
One of the most common questions I get from clients that are on our shared hosting services is, “When I type in the IP address you gave me, it doesn’t resolve to my site, it resolves to some other site.” When you have a shared hosting account on a server, many people will use the same IP address. What this means is that the server will know how to direct the visitor based on the domain name. If you need to have your IP address point to your site for some reason, that will often cost more money. Usually, that is not required for most corporate or private websites.
I think it's fair to say that there are plenty of exceptions to these rules. This post is meant as only a high-level understanding. Even when we help make a website go live we might do something different. However, this is a pretty good overview of how it works.
Written by Corey Smith
Corey Smith is the founder of Tribute Media and serves as the Digital Marketing Strategist. He is also the author of "Do It Right: A CEO's Guide to Web Strategy" and "Tweet It Right: A CEO's Guide to Twitter."