Our website is in Dutch; support is available in English.

DNS records explained: A, AAAA, CNAME, MX and TXT

For each record type, what it does, when you use it and what it looks like, plus why you lower the TTL before a move.

Updated 4 minute read

Contents of this article
  1. What DNS does
  2. The five record types
  3. TTL: how long an answer sticks around
  4. What we don't do here
  5. Further reading

DNS is your domain's address book. Five record types do most of the work in it. This page explains, for each type, what it does, when you use it and what it looks like.

What DNS does

A visitor types your domain name, but computers work with IP addresses. DNS translates one into the other. Your domain's DNS zone holds records: entries that say where the website is, where email should go and what extra information receivers can look up.

Each record has a name (which part of your domain), a type, a value and a TTL. The TTL comes back at the bottom of this page, because that is where things usually go wrong during a move.

The five record types

A: a server's IPv4 address

An A record points a name to an IPv4 address. This is the record that makes your website reachable. You use it for your main domain and for subdomains hosted on their own server.

DNS
example.nl.  3600  IN  A  192.0.2.10

AAAA: the same, but for IPv6

An AAAA record does exactly what an A record does, but with an IPv6 address. You set A and AAAA side by side: visitors with IPv6 then use IPv6, everyone else IPv4. Without an AAAA record your site still works, just not over IPv6.

DNS
example.nl.  3600  IN  AAAA  2001:db8::10

CNAME: a name that points to another name

A CNAME says: for this name, look at that other name. Useful when a service manages its own address and changes it now and then, so you don't have to keep track of IP addresses yourself. Use it for subdomains such as www or the address of an external service.

DNS
www.example.nl.  3600  IN  CNAME  example.nl.

Keep one rule in mind: no other records may exist on a name that has a CNAME. That is why you normally can't use a CNAME on your main domain itself, because MX and TXT records already live there. Use an A and an AAAA record there instead.

MX: where your email should be delivered

An MX record points sending mail servers to the server that accepts mail for your domain. The number in front is the priority: lower goes first. You set several MX records when there is a second server as a fallback.

DNS
example.nl.  3600  IN  MX  10 mail.example.nl.

If you switch mail provider, this is the record that changes. Changing just this record is enough to route mail to the new server; your website stays where it is.

TXT: free text that receivers read

A TXT record contains plain text. In practice you use it for two things: email security (SPF, DKIM and DMARC), and proving that you control the domain when a service asks for it.

DNS
example.nl.  3600  IN  TXT  "v=spf1 mx -all"

There is more to say about the email records than fits here. They are covered in detail on our page about domain protection for email (in Dutch).

TTL: how long an answer sticks around

The TTL (time to live) is in seconds and says how long other DNS servers may remember your answer. A TTL of 3600 means that a resolver that looks up your record today trusts it for an hour without checking again.

That is useful: it makes DNS fast and keeps the number of queries down. But it also means a change isn't known everywhere straight away. Anyone who already has your old address in memory keeps going there until the TTL has expired.

Why you lower the TTL before a move

If you are going to move a website or mailbox, set the TTL of the records involved low a day or two beforehand, for example 300 seconds. Then wait at least as long as the old TTL, so the low number has really reached everywhere. Only then do you change the value.

The effect: the switchover takes minutes instead of hours, and if something goes wrong, you can go back just as quickly. Once the move has succeeded and is stable, set the TTL back to its normal value.

What we don't do here

This article explains the five records you come across most often. It is not a complete DNS reference: SRV, NS, SOA and DNSSEC are left out here, and we don't go into the settings of specific services. For CAA and TLSA, the two records that determine who may issue a certificate for you and which certificate should be in place, we have a separate article: TLSA and CAA records explained. If your DNS is managed by another party, we can't look into that zone for you. What you do get from us is a DNS editor in which you can change this yourself, and help if you aren't sure what a record does.

Further reading

Was this article helpful?

Still stuck?

Send us a message. We will help you, usually within one working day.