The domain name system (DNS) is a key part of internet infrastructure. It’s a concept that’s simple from a high-level overview, but when you get down into the trenches, it becomes very complex. It can be easy to feel lost when faced with acronyms like spf, aaaa, dkim and dmarc.
Webmasters often have to delve into the world of DNS records to solve everyday problems.
Fortunately, it’s not necessary to master all its intricacies to successfully manage them. A basic understanding will cover many of the scenarios you’ll encounter.
What are DNS records used for?
DNS was created to solve the dilemma that whilst computers work best with numbers, people do not.
Its basic function is to map names to numbers, like a phone book.
As you probably already know, every device, or host, that connects to the internet is identified by a number in the form of an IP (internet protocol) address that looks something like this:
123.456.98.22.
An IP address must be unique within a network. For websites, the network is the entire internet.
In DNS, an individual mapping that links an IP address to a resource is called a resource record. Resource records are collected into zones, which are stored on nameservers.
DNS 101: DNS records are stored on DNS servers — aka authoritative dns servers. These records provide information about domains, including which IP address these domains translate to and how requests made to each domain should be handled.
Fun fact: There are two different versions of Internet Protocol (IP). IPv4 was the first version and IPv6 was the second. Most people won’t ever need to know the intricacies of IPv4 and IPv6 addresses. But it may interest you to know that IPv6 was created to allow for the creation of even more IP addresses than ever before.
Editor's note: Manage all your client accounts with free tools from GoDaddy.
DNS terminology
Here’s a bit more detail on the important DNS terms:
Resource Record (RR)
A resource record is a one-line text description that defines a particular resource. It’s the base unit of the DNS system. A resource record consists of multiple fields separated by whitespace or tabs, in the following generic form:
Name: The host name for the record.
TTL: Time to live in seconds. This is the amount of time the record is allowed to be cached. A TTL of 3600 means the record will update every hour. A TTL of 86400 means it will take a day for changes to update.
Class: A value that describes the protocol family being used. Most often, this is set to IN, which means “internet protocol.”
Type: Identifies the resource record type, which is an abbreviation for the type of data stored in the subsequent data field. Examples include A (address) and MX (mail exchange), among others.
Data: The data payload needed for the particular type of record. This part may contain one or more elements separated by white spaces.
We’ll talk more about specific resource record types you may need to work with later in this article.
Zone file
The resource records pertaining to your domain are stored in a zone file.
A DNS zone is a subset of the domain name system, often a single domain.
A zone file contains the mappings between IP addresses and names within that subset, in the form of individual resource records that point to different aspects of the domain.
It can also contain directives and comments. Your domain’s zone file is stored on its nameserver.
Nameserver
A nameserver is a specialised server that handles queries about the location of a domain name’s services, such as your website or email. You “point” your domain to particular nameservers by assigning them in your domain’s DNS settings.
Typically, your nameservers will be those of the web hosting company you registered your domain with, but not always.
A site’s DNS settings will include at least two nameservers, a primary and a secondary. If the primary server isn’t responding, then the secondary server will be used to resolve the request.
Commonly modified DNS records
There are more than 30 types of DNS records that can potentially be implemented. Luckily, just a handful of them are of practical use to most webmasters.
Those you’re most likely to encounter include:
CNAME record
CNAME stands for canonical name.
A CNAME record is used to redirect from one domain name to another automatically.
Let's say you wanted store.yourdomain.com to automatically redirect to your eBay store. You could add a CNAME record to accomplish that.
This is how it would look:
store.example.com 86400 IN CNAME yourstore.ebay.com
A record
The A, or Address record, is one of the most-used record types. A records allow you to map a domain name to an IP address.
When adding an A record, the domain name is automatically appended to the name you enter.
So, for example, if you want to make an A record for www.example.com, you would only need to add www for the name value. The example.com part is automatically assumed.
For example:
www 86400 IN A 123.456.78.90
TXT record
A TXT record allows you to add text data into your domain’s DNS records. A common use is ownership verification.
For example, if you want to use Google Webmaster Tools, one way of proving you own the domain is to add a TXT record containing a randomly generated string provided by Google. Google then checks to see if the record exists to confirm you control the domain.
Example:
example.com 86400 IN TXT randomstring
MX Record
MX stands for mail exchange. An MX record points to the mail server that should be used to deliver mail for a domain using SMTP (simple mail transfer protocol).
MX records always point to a domain, not an IP address.
If a domain doesn’t have an MX record, a sending server will attempt to deliver mail to the domain’s A record instead.
Example:
86400 IN MX 10 mail.domain.com
Note that an MX record doesn’t list a host name at the beginning. That’s because it applies to the entire zone. The 10 is an extra number that sets the priority of this record if multiple mail servers are defined. Lower numbers have higher priority.
NS record
As mentioned earlier, an NS record indicates which server is responsible for processing queries for a domain.
If you change hosting to somewhere other than where you registered your domain, you would need to update the NS records.
Example:
example.com 86400 IN NS ns1.yourprovider.com
PTR record
A PTR (pointer) record, also called a reverse DNS record, resolves an IP address to a domain name.
This is exactly the opposite of what an A record does.
PTR records are mainly used to check if a server name is associated with the IP address from where a connection was initiated.
PTR records are often used for outgoing mail servers because many mail providers will reject or mark as spam messages received from servers that don’t have a valid PTR record.
This is a little more complicated than simply adding a DNS record, as a reverse zone must be set up first.
GoDaddy administrators configure reverse DNS on all their email servers. If you use another provider, contact the provider of your IP address for help configuring reverse DNS.
You may also like: What small company accounting software can do for you
Adding or changing DNS records in cPanel
If you’re using a hosting plan with cPanel and decide to point your domain at your host’s nameservers, you’ll need to use cPanel to manage the DNS records.
In cPanel, you’ll find an icon for the DNS Manager under the Domains section.
Clicking on that will get you to where you can edit the records.
When changing DNS records, remember that there’s a lag time before the change will actually take effect. That lag time is defined by the TTL value set for the record.
For that reason, it’s a good idea when editing DNS records to first go in and temporarily reduce the TTL time. Once that change takes effect, you can make your final edits.
This way, your change occurs more quickly, and if you make a mistake when entering your final record, you won’t have to wait hours or days to fix it.
Should you use your domain registrar, or hosting provider to manage DNS records?
That’s entirely up to you, and there are pros and cons to both approaches.
Using your registrar’s nameservers lets you manage all domain configuration in one location. But if you use a lot of addon domains or subdomains in your hosting plan, your host’s nameservers will automatically configure the corresponding DNS records.
A simple domain transfer from your current registrar to your hosting provider (so both are in one place) can make your life much simpler.
At-a-glance glossary of other terms
Here are a few other terms you may come across when working with your DNS service:
DNS lookup: This is the behind-the-scenes process by which a text domain name is translated into a numerical address that can be read by a computer.
Enter a domain address in text (these processes are also known as a DNS queries) and a DNS resolver will request the IP address.
SPF record: A Sender Policy Framework record is a type of TXT record (as defined above). These sort of records stipulate which servers can send emails from a particular domain. These records are designed to prevent email fraud.
AAAA record: We mentioned this in the introduction to the article, so we felt like we had to explain it here, even though you probably will never need to use it.
An AAAA record is required when a domain has both an IPv4 and IPv6 address and the client device is set up to use IPv6.
Caa record: Caa stands for Certificate Authority Authorization. These records reveal which certificate authorities are allowed to issue certificates for a domain.
Soa record: The Start of Authority record stores details such as the email address of the administrator .