Wednesday 24 April 2013

Understanding the Domain Name System (DNS)


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. The problem you face is that you lose control of your website. If something happens to your developer or you have a falling out, your website and email can stop working... in a heart beat.
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 follow these rules.
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 (My Recommendation)
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 great... plus, I can help you if you run into problems. If you aren't with them, I recommend moving your domain registration to them.
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.
At Your Web Hosting Company
I never recommend this. I won't allow my clients to host their name server records on my server. I don't want to be responsible if something goes wrong with their email or other services. The only way I can ensure that their email works is if I don't manage those records. If you use a reputable Domain Registrar (like GoDaddy.com) then this should never be a concern. There are some valid reasons why this can be a recommended choice, but more often than not, I do not recommend this.
Problems with DNS records hosting.
Have you ever noticed sometimes that you go to http://example.com you don't get the same result as when you go tohttp://www.example.com? That usually is a problem with the way the DNS records are hosted. Sometimes even the domain registrar will get this wrong. It can almost always be fixed at the DNS host, but I have never had a problem with my DNS hosting at GoDaddy.com... which is one reason why I recommend them.
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 name the internet should associate with the name. For example, you can find this site at http://69.64.89.204 but since that is not an easy number to remember, the A record tells the internet that when you type inhttp://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.
CNAME
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 tohttp://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. As I mentioned above, I recommend that you leave the Name Server at your domain registrar like GoDaddy.com.
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.

No comments:

Post a Comment