DNS stands for the Domain Name System. The DNS records tell the internet where to send your internet traffic. The most common are address (A) records, CNAME records, name server (NS) records, and mail exchange (MX) records. This article will take a look at each of these.
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.
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.
There are a lot of different types of records that exist for the internet, but 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.
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. Many hosting providers (including HubSpot, where I am hosting) require the domain name to know how to point you to the right place. So, you won't be able to type in an IP address and commonly get a website... but they are there nonetheless.
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.
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.
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.
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.
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.