Nov
10

DNS Records Explained: A, CNAME, MX and TXT

11/10/2026 12:00 AM

DNS Records Explained: A, CNAME, MX and TXT

When you type a website address into your browser, a system called DNS finds out where that website lives. DNS records are the entries that hold this information for your domain. They decide where your website is served from, where your email goes, and how other services check that your domain belongs to you. This guide explains the most common DNS record types in simple words.

What Is DNS?

DNS stands for Domain Name System. Computers find each other using numbers called IP addresses, but people remember names such as example.com. DNS connects the two. It works like a phone book that turns a domain name into the details a computer needs.

The information for your domain is stored on a DNS server as a set of records. You usually manage them in the control panel of your domain registrar or hosting company.

What Is in a DNS Record?

Most records have the same basic parts:

  • Type: what kind of record it is, such as A, CNAME, MX, or TXT.
  • Name (or host): which part of the domain the record is for. The root domain is often shown as @, and a subdomain such as blog refers to blog.example.com.
  • Value: where the record points or what information it holds.
  • TTL: how long, in seconds, other servers may remember the answer before asking again.

A Record

An A record connects a domain name to an IPv4 address. This is the record that tells browsers which server hosts your website.

Name: @
Type: A
Value: 192.0.2.10

If your site moves to a new server, you usually change the A record to the new address. The address above is an example reserved for documentation and is not a real server.

AAAA Record

An AAAA record does the same job as an A record, but for an IPv6 address, which is the newer and longer type of address. If your host gives you both kinds of address, you can add both records.

CNAME Record

A CNAME record makes one name an alias of another name instead of pointing to an IP address.

Name: www
Type: CNAME
Value: example.com

Here, www.example.com follows wherever example.com points. If the main address changes, the alias follows it automatically.

Rules to remember

  • A name that has a CNAME should not have other records with the same name.
  • A CNAME is normally not used for the root domain itself. Some providers offer special alias features for this.

MX Record

MX stands for Mail Exchange. These records tell the internet which servers receive email for your domain.

Name: @
Type: MX
Priority: 10
Value: mail.example.com

The priority number decides the order. A lower number means higher priority, so mail is tried first at the server with the lowest number. If that server is not available, the next one is tried. The value of an MX record is a hostname, not an IP address.

If you use an email service such as a hosted mailbox, your provider will give you the MX records to add.

TXT Record

A TXT record holds plain text. It does not send visitors or email anywhere. Instead, other services read it to learn something about your domain. Common uses are:

  • Domain verification: services such as search tools or email platforms ask you to add a code to prove you own the domain.
  • SPF: lists the servers that are allowed to send email for your domain.
  • DKIM: publishes a key that is used to check that emails were not changed on the way.
  • DMARC: tells receiving servers what to do with emails that fail those checks.

Correct email records help your messages reach the inbox instead of the spam folder.

Other Records You May See

  • NS: shows which name servers are in charge of the domain's DNS records.
  • SOA: holds administrative details about the domain's DNS zone.
  • PTR: connects an IP address back to a name, and is mostly used for email servers.
  • SRV and CAA: used for specific services and for controlling which authorities can issue security certificates for the domain.

What Is TTL?

TTL, or Time To Live, tells other servers how long they may keep a record before they ask again. A short TTL, such as 300 seconds, means changes spread faster, and a longer one reduces the number of lookups. If you plan to move a website, many owners lower the TTL a day or so earlier so that the change takes effect quickly.

Why Do DNS Changes Take Time?

When you change a record, other servers around the world may still have the old answer saved until its TTL ends. This is often called DNS propagation. Some changes seem to work within minutes, while others can take several hours or longer, so be patient and avoid changing the same record again and again.

How to Check Your DNS Records

  1. Log in to the control panel where your domain's DNS is managed and look at the list of records.
  2. Use an online DNS lookup tool to see what the rest of the internet sees.
  3. Compare the results with what you intended to set.

On Windows, Mac, and Linux, you can also use the command line. For example, nslookup example.com shows the address for a domain.

Common DNS Problems

  • Website not loading after a change: the old answer may still be saved, or the A record may point to the wrong address.
  • Email not arriving: check that the MX records are correct and that there are no old, conflicting records.
  • Emails going to spam: check the SPF, DKIM, and DMARC TXT records.
  • CNAME conflicts: a name that has a CNAME cannot also have other records.
  • A typo in a value: one wrong character can stop a record from working.

Frequently Asked Questions

What is the difference between an A record and a CNAME record?

An A record points a name to an IP address. A CNAME points a name to another name.

Can I have more than one MX record?

Yes. Many domains have several, each with a priority, so that mail still arrives if one server is down.

Can a domain have more than one TXT record?

Yes. A domain often has several, for verification codes and email security. There should be only one SPF record, though.

How long does it take for DNS changes to work?

It depends on the TTL and on the servers involved. It can be minutes, or several hours in some cases.

Where should I change my DNS records?

Wherever your domain's name servers are managed. This is often your registrar, your hosting company, or a separate DNS service.