A Beginner's Guide to DNS Records: A, CNAME, MX, TXT and more

Name server configuration can feel daunting. You’re doing your best to follow instructions, but different sites seem to tell you different things. You’re pretty sure you have entered the right values, but you’re not entirely sure what they’ll do. It can be a frustrating situation and often comes down to a limited understanding of DNS fundamentals. Without this foundation, it is easy to feel stuck and start trying every solution you can find, just hoping one works.

Let's take a step back and build a solid understanding of what DNS really does.

What is DNS? #

When a machine looks for your domain, for example when someone visits your website or sends you an email, it first contacts a nameserver. The nameserver stores your DNS records, which direct your request to the right place, such as your website or inbox. These records don’t live on your webserver but on the nameserver itself, and they contain the information needed to perform the machine-to-machine connection smoothly.

To learn more about a DNS read up on how your domain name connects web browsers to your website.

DNS Record Types #

DNS acts as the internet’s contact list, with DNS records operating like the individual fields in a contact entry. Just as a contact may contain multiple fields of information, such as a home phone, work phone, email, or address, a domain name can have different types of DNS records storing important information.

A Record (Address Record) #

An A record acts like a home address, serving as the main hosting address. It connects a domain name to an IPv4 address, allowing web browsers to locate the server hosting the website.

An IPv4 address is essentially a unique number that identifies a device on a network. If a website is migrated to a new server, the A record must be updated to reflect the new server location.

A records only work with IPv4 addresses, which use a 32-bit system, limiting the total number of addresses to around 4 billion. This limitation led to the creation of IPv6 to support the internet's growth.

AAAA (Quad-A Record) #

The AAAA record functions just like an A record does but specifically for IPv6 addresses. Their purpose aligns but their address format support differs.

IPv6 addresses use a 128-bit scheme, represented in hexadecimal notation, with segments separated by colons. This may sound confusing but it’s really just a way of writing numbers using 16 symbols (0-9 and A-F), which makes it easier to work with computer numbers than using long strings of 0s and 1s.

This expansion addresses the concerns regarding the impact of internet growth on the possible IPv4 combinations.

Both A and AAAA records can list multiple IP addresses on a single domain name. This allows for – if one server fails, another can take over – and advances routing, which sends users to different servers based on factors like location, server load, or availability, making websites faster and more reliable.

CNAME Record (Canonical Name Record) #

A CNAME record allows one domain name to act as an alias for another main domain, called the canonical domain.

A common example is the “www” version of a website, under which www.example.com can point to example.com.

This is particularly useful when different parts of a site run on separate servers. For example, your main website could be on one server, whilst your blog subdomain is on another, but both can still use the same main domain name, maintaining brand consistency.

MX Record (Mail Exchange Record) #

An MX record tells the internet where to deliver emails for your domain, directing incoming emails to the correct mail server. When someone sends you an email their mail server checks your domain’s MX records to find out which server is responsible for handling your emails. Many domains have multiple MX records with priority settings, meaning emails can still arrive even if one server is down, ensuring reliable email delivery.

TXT Record (Text Record) #

Text records operate as a note attached to your domain providing the internet with important information. As the name suggests, you can store any text you like as a TXT record. There are some formats of TXT records that do specific jobs, for example helping mail systems recognise that you are not a malicious spammer. Examples of things you can do with TXT records include:

  • Verifying domain ownership – For example Google Search Console provides a unique code which, when saved as a TXT record, confirms you as the domain owner and adds the domain to your Search Console.
  • Communicating email sender policies (SPF) – These identify which servers send emails from your domain. A mismatch is a potential sign of spam.
  • Protecting your domain from misuse (DMARC) – Another email-related policy, DMARC works with SPF and guides recipients who are handling suspicious emails.

SRV Record (Service Record) #

SRV records tell the internet where to find a specific service on your domain, like instant messages, voice over, or other applications. They provide the hostname and port numbers, allowing for service discovery without requiring knowledge of the IP address.

SRV follow this specific format:

_service._protocol.domain.com

Choosing a Domain Provider #

It is crucial to note that not all domain providers allow you to create or manage all types of DNS records. Some only allow basic records like A or CNAME, while others may charge extra for premium DNS features.

This is an important consideration to keep in mind when comparing different domain providers. See our comparison table for a side-by-side look at prices and features.

DNS doesn't have to be DIY #

Managing DNS records might seem complicated at first, but understanding what each record does makes it much easier. Setting them up correctly helps ensure your website, email, and other online services run smoothly.

If you are unsure or lack experience with DNS, this is another reason to look for high-quality support when you choose your domain or hosting provider. Their advice and guidance can ensure proper DNS configuration for you.