Categories
DNS Domains

Domain Name System (DNS)

What is this DNS I keep hearing about and what does it do? Does it affect my domain name and website?

Overview

A lot of what web hosting does for you is affected by DNS (Domain Name System), but what is it and how does it work? While we can’t get too deep into the mechanics of DNS, we will try to explain the basics of what DNS is and how it affects your hosting.


What is DNS

DNS stands for Domain Name System (or Service). The easiest way to think of DNS is to compare it to a phone book. Computers look up other computers by their IP address (think of it as a phone number), but people use names. You would not call out to your friend in a crowded restaurant using their phone number, would you? The same is true with websites. Would you rather tell your customers or users to go to mycoolsite.com, or 192.168.42.69?

So, when you want to call someone (website) and you don’t know their number (IP address), what do you do? Well, a long, long time ago, you would use an ancient tome called a phone book. Here, you could look up a person or business by their name and it would show you what their phone number was. This is basically what DNS does for websites. When you enter mycoolsite.com in your browser (your friend’s name), your browser checks with DNS servers (phone book) to see what IP (phone number) to connect you to. This is a very simplified version of what happens, but it should work fine for the scope of this guide.

A domain name consists of several parts, separated by periods, but needs at least two parts, the domain name as well as the TLD (top level domain). In the example of example.com, ‘example’ is the domain name and ‘com’ is the TLD. There can also be subdomains such as newsite.example.com.

DNS servers read domains from right to left, in a way. When a DNS resolver is searching for a domain, it firsts checks the TLD, then domain name, and then any subdomains.

In the example above (newsite.example.com) the DNS resolver with first check the .com name server. This will provide the authoritative name server for the domain name, ‘example’. Once it gets to the authoritative name server, it will find the Zone File for the domain. This zone file will have the IP addresses for the main domain (blank record) as well as any subdomains (newsite.example.com).

Back to Top


The DNS chain

Whenever you enter a domain in your browser, there is a chain of events that occurs. Once again, this is a very simplified version of events.

  1. First, the browser will send the request to your DNS resolver. This is a typically controlled by your ISP or internet service provider.
  2. The resolver will first check to see if it has a cached IP for that domain. If it has an IP for the domain that has not expired (cached DNS records have a set lifespan or Time To Live or TTL), it will send that IP to the browser and the chain ends here. If it does not have a cached IP, it will pass the request on to the proper TLD (Top Level Domain) server.
  3. The TLD server contains information on all the domains with the same TLD. The TLD of the domain is the last part of the domain (in example.com, the TLD is .com). Once it finds the authoritative name server for the domain in question, it will pass the request to it.
  4. The Authoritative nameservers for the domain is the nameservers set by your domain registrar. Once at the nameserver, it can read your Zone File and find the IP address that it is looking for and respond to the browser with the IP address to connect to.
A flow chart showing the DNS lookup process.
The DNS chain

Back to Top


Where do I find my DNS?

The DNS records for your domain reside on your DNS provider’s nameservers in what is called a Zone File. You can have zone files for your domain on as many nameservers as you wish, but the only zone that will be active is the one stored on the nameservers your domain is currently pointing to.

The way to access your Zone File depends on what service you have.

If you have a cPanel account, you can edit these records using your DNS Zone Editor in your cPanel. You can find out how here. If you do not know how to access your cPanel, you can find out here.

There are also several online tools that you can use to see a domain’s DNS records. A Google search for “DNS lookup” should return several results.

Back to Top


What type of DNS records can I have?

There are several different types of DNS records you can use for different tools and services. You can find more information here.

Back to Top


What does my DNS zone file contain?

A typical DNS zone file will contain several records that control where domain traffic is forwarded to. When you create a new account (or add an addon domain or subdomain), a default zone file is created as well. In most cases, you should not need to change anything. However, there are cases when you will need to update these records. We will give a few examples below.

Every zone file needs to contain one blank (sometimes referred to as ‘@’) A record that points to an IP address. This is required and the zone file is not valid if you don’t have this set.                                                                                                                          

Website records

These control your website and ftp client connections. Your website records are created when you set up your services for the first time. In most cases, these records do not need to be updated. By default, you should have the following:

  • a blank A record for example.com set to the server IP address
  • a CNAME record for www.example.com that points to example.com
  • an A record or CNAME for ftp.example.com that points to example.com

If you have any subdomains or custom name servers for this domain, those records will be here as well.

Email records

These records control your email traffic and ensure that your emails make it to your mail server.

  • MX records for example.com (there can be several for redundancy)
  • several A or CNAME records to assist with mail clients (Ex. pop.example.com, imap.example.com, smtp.example.com, autodiscover.example.com)
  • several TXT records to help with mail verification (see here for more information)

Other domain records

By default, there are several other records created for additional services that you may not use (webdisk, cpcontacts, cpcalender, etc). It is not necessary to delete these records, even if they are not needed.

Back to Top


When should I update my DNS records?

As long as you are using our services, you typically do not need to update your DNS records. However, there are times when you will need to update your records.

Third party website

If you decide to use a third party service to host your website, you will need to update the records to point website traffic to the new server. Your new host should be able to provide you with these records. These typically consist of one or more blank (or may be named ‘@’) records as well as records for www.example.com (can be A or CNAME). There may be other records as well, such as records for ftp access (ftp.example.com) and other services.

Third party email host

If you are using someone else for your email hosting, you will need to update the mail records accordingly. This information should be provided by your new host. This will normally consist of MX records, and possibly other TXT and A or CNAME records.

Third party email or filters

If you are using a third party email service or filter, you will need to update the MX records so the mail goes through the filter before it is forwarded to your mail server. Once again, your email or filter provider should be able to provide you with this information.

Other services

Depending on what other services you require, there may be additional records that need to be added to your zone file.  Your service provider should be able to provide what records their services require.

Back to Top


An Important Note About DNS

Whenever you update your DNS, it can take time for the changes to propagate across the internet. While this is typically updated within four to six hours, we recommend waiting up to twenty-four hours for records to fully propagate.

Back to Top


If you have any further questions, please be sure to reach out to our support staff by using our chat service in your client area or by submitting a ticket.