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 direct your customers or users 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 can look up a person or business by their name, and it will show you their phone number. 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 simplified version of what happens, but it should suffice for the scope of this guide.

A domain name consists of several parts, separated by periods, and requires at least two parts: the domain name and 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 first checks the TLD, then the domain name, and then any subdomains.

In the example above (newsite.example.com), the DNS resolver will first check the .com nameserver. This will provide the authoritative nameserver for the domain name, ‘example’. Once it reaches the authoritative nameserver, it will locate the Zone File for the domain. This zone file will contain the IP addresses for the main domain (blank record) as well as any subdomains (e.g., newsite.example.com).

The DNS Chain

Whenever you enter a domain in your browser, a chain of events occurs.

Step 1: First, the browser will send the request to your DNS resolver. This is typically controlled by your ISP or internet service provider.

Step 2: The resolver will first check if it has a cached IP address for that domain. If it has an IP address 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 address to the browser, and the chain ends here. If it does not have a cached IP, it will forward the request to the proper TLD (Top-Level Domain) server.

Step 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 nameserver for the domain in question, it will pass the request to it.

Step 4: The Authoritative nameservers for the domain are 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.

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 to which your domain is currently pointing.

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.

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

What type of DNS records can I have?

There are several types of DNS records that you can add to your domain's DNS zone file. These can be used for managing your website traffic and emails, as well as for various other services. Here are examples of some of the more common types of DNS records.

A Record

An A record maps domain names to IP addresses. 

example.com --> 192.168.42.69

They are essential to DNS functionality because they direct your website traffic and emails to the correct server. Without appropriate A records, your visitors cannot access your website, and your emails will not function correctly.

The main record for your domain is known as a blank A record ( example.com, though some services refer to it as “@. example.com”). Every zone file requires this blank A record to be considered a valid zone file. All A records must be set to an IP address.

example.com. IN A 3600 192.168.42.69
www.example.com. IN A 3600 192.168.42.69
ftp.example.com. IN A 3600 192.168.42.69

CNAME Record

CNAME records are similar to A records (and AAAA records for that matter). The difference is that instead of resolving to an IP address, they will resolve to a domain name (e.g.,. example.com).

mail.example.com --> example.com

The main advantage of using CNAME records is that if you have several services that are all pointing to the same server, you can use a CNAME record to point them all to the blank A record. That way, if the server IP ever changes, you only need to update the blank A record, and the CNAME records will still work.

example.com. IN A 3600 192.168.42.69
www.example.com. IN CNAME 3600 example.com
ftp.example.com. IN CNAME 3600 example.com
mail.example.com. IN CNAME 3600 example.com

TXT Record

TXT records contain text information used by various services, primarily for verification purposes. For example, TXT records can specify data for the SPF (Sender Policy Framework) or DKIM (DomainKeys Identified Mail) email authentication systems. They are also used for domain verification for SSL certificates, as well as several other services.

example.com. IN TXT 3600 "This domain is cool"

TXT records can be any text, but are limited to 255 characters (bytes) in length.

MX Record

MX records (also known as Mail Exchange) are required for your email services. This is what directs emails to your mail server.

example.com. IN MX 3600 0 mail.example.com

While these records are set up by default, if you are not using our mail service, you will need to update these records.

  • Name: typically the domain name (example.com)
  • TTL (or Time To Live): can stay at the default
  • Type: MX
  • Priority: It is common to have several MX records in your zone file for redundancy reasons. The DNS server will attempt to resolve the MX record with the lowest priority number first, then the next lowest, and so on. Different MX records can be set to the same priority.
  • Destination: this would be the domain name of your mail server (e.g., mail.example.com)

AAAA Record

AAAA records are the same as A records but use an IPv6 address instead of an IPv4 address. It is unlikely that you will ever need to use this type of record; however, your service provider should be able to provide you with the necessary details.

CAA Record

CAA records are used to identify what certificate authorities are allowed to issue certificates for your domain. This is an advanced feature, and you would need to get this information from your certificate issuer.

SRV Record

SRV records are used to provide information about additional services on specific ports on your server. This is more for advanced users. Any service requiring SRV records should give them to you.

The target for an SRV record must point to an A or AAAA record.

What does my DNS zone file contain?

A typical DNS zone file contains several records that control where domain traffic is forwarded. 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 make any changes. 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 require updates. By default, you should have the following:

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

If you have any subdomains or custom nameservers for this domain, their corresponding records will also be listed here.

Email Records

These records control your email traffic and ensure that your emails reach your mail server.

  • MX records for example.com (there can be several for redundancy)
  • Several A or CNAME records to assist with mail clients (e.g., 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, several additional records are created for services that you may not use (webdisk, cpcontacts, cpcalender, etc.). It is not necessary to delete these records, even if they are not needed.

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. Your new host should provide this information. This will typically consist of MX records, along with 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 that the mail is routed through the filter before being 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 the other services you require, additional records may need to be added to your zone file. Your service provider should be able to provide the records their services require.

How long does it take for DNS changes to take effect?

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 propagate fully.

If you have any further questions, please ask to speak with a live customer service specialist or email support@christianwebhost.com for further assistance.