Guides Blogs 7 min read 1,247 words

What is a DNS Record?

A DNS record is one instruction on a domain's nameservers: an address, a mail server, a text value. Here are the types you edit and the rules people trip over.

A DNS record is a single instruction stored on a domain's authoritative nameservers. It tells the rest of the internet something about the domain: which IP address serves its website, which servers accept its email, which nameservers are in charge of the zone, and more. The collection of records for one domain is its DNS zone.

Records are what you actually edit when you "change DNS". This guide explains the format, the types you will meet most often, what each one does, and the rules that cause most configuration mistakes.

What a DNS record is

DNS itself is a distributed database. Each entry in it is a resource record, and each record answers one kind of question about one name. When a browser asks for the address of example.com, it is asking for the A record at that name; when a mail server wants to know where to deliver mail for the domain, it asks for the MX records.

Records live on authoritative nameservers, not at the registrar. The registrar only tells the registry which nameservers to ask. That is why editing records at your DNS provider takes effect without any change at the registrar. If the terms are new, start with how DNS works and what a nameserver is.

What every record contains

Registrar and DNS provider interfaces differ, but a record always carries the same core information:

FieldWhat it holds
NameThe hostname the record applies to. The @ symbol usually stands for the domain itself, and www is a subdomain.
TypeThe kind of record, for example A, AAAA, CNAME or MX. The type decides how the value is read.
ValueThe data itself: an IP address, a hostname, a text string or a number, depending on the type.
TTLTime to live in seconds. It sets how long resolvers may cache the answer before asking again.

Some types add one more field. MX records carry a priority, SRV records carry a priority, weight and port, and CAA records carry flags and a tag.

Five common DNS record types: A maps to IPv4, AAAA maps to IPv6, CNAME aliases a name, MX routes mail, and TXT stores text.

The record types most domains use

A website and its email typically need only a handful of record types. These are the ones you will edit most often.

A record

Maps a name to an IPv4 address. The A record at the bare domain is what makes example.com load a website, and the same type is used for subdomains such as www.

AAAA record

The IPv6 counterpart of the A record. A name can have both an A and an AAAA record, and clients choose between usable addresses according to their connection-selection behaviour.

CNAME record

Points one name to another name instead of to an address. If blog.example.com is a CNAME for example.com, a lookup of the blog follows the alias and returns the address of the target. This is useful when several names should follow a single A record: change the target once and every alias follows.

MX record

Directs email for the domain to a mail server. Each MX record has a priority number, and the lowest number is tried first, with the others acting as backups. If you run mail elsewhere, these records are what make your addresses receive mail.

TXT record

Holds free text. Its two main uses today are email authentication, where SPF, DKIM and DMARC policies are published as TXT records, and domain ownership verification for services that ask you to add a code.

NS record

Lists the nameservers that are authoritative for the zone. Parent-zone delegation NS records are configured through the registrar. The authoritative zone also contains its own NS records; keep the two sets consistent.

SOA record

The start of authority record. It marks the beginning of the zone and holds administrative data: the primary nameserver, the administrator's mailbox, a serial number that changes when the zone is updated, and timers that control how secondaries refresh and retry.

SRV record

Describes where a specific service runs, including host and port, so clients can find services such as voice or messaging without being told the exact host in advance.

PTR record

The reverse of an A record: it maps an IP address back to a name. PTR records are used for reverse DNS lookups, which mail servers often check when deciding whether to accept a message.

CAA record

States which certificate authorities are allowed to issue certificates for the domain. A CA is expected to check the CAA record before issuing, which reduces the chance of a certificate being issued without your consent.

Records used for email authentication

Three TXT-based mechanisms do most of the work in stopping forged mail:

  • SPF lists the servers that may send mail for the domain.
  • DKIM publishes a public key used to verify a signature added to outgoing messages.
  • DMARC is published at _dmarc.example.com and publishes the requested handling policy when neither SPF nor DKIM produces an aligned pass, plus any reporting destinations.

These are ordinary TXT records with a defined syntax, so their syntax and record-set rules matter. Multiple TXT records are normal, but publishing more than one SPF policy at the same name produces an SPF error.

Less common record types

IANA maintains the registry of record types, and it is long. Most of the entries exist for specialised purposes. The ones a domain owner may still meet:

  • DNSKEY, DS, RRSIG and NSEC belong to DNSSEC. They publish public keys and signatures so resolvers can verify that an answer is genuine, and NSEC proves that a name does not exist.
  • DNAME redirects an entire subtree of names to another domain, unlike a CNAME which covers one name.
  • RP records the responsible person for the domain as an email address.
  • TLSA associates a certificate with a name for DANE, a way of tying TLS certificates to DNS.

The rules that cause most mistakes

Most broken configurations come from a small number of constraints rather than from obscure types.

  • A CNAME cannot share its name. If blog.example.com has a CNAME, it cannot also have ordinary A, TXT or MX data at the same name; DNSSEC-related metadata is an exception. Everything else belongs at the target name.
  • CNAMEs point to names, not addresses. A CNAME value is always a hostname, never an IP address.
  • MX and NS records cannot point to a CNAME. They must resolve to an address record.
  • Changing a value does not clear caches. The old answer stays in resolvers until its TTL expires, so a change can appear to work for some visitors and not others.
  • Multiple records are not always errors. Multiple A records are valid and can return several addresses, with clients choosing how to connect. More than one SPF policy at a name produces a permanent SPF evaluation error.

How to look up a domain's records

You do not need access to the account to see the public records. A DNS lookup tool queries the nameservers and shows what the world receives, which is the fastest way to confirm that a change is live. Our WHOIS and DNS lookup returns the records for any domain, and finding where a domain is hosted explains how to read the result.

If the records look right but the site still fails, the problem is often the nameservers rather than the records. Where is my domain registered helps you find the account that controls them.

Sources

For the mail-policy constraints, see SPF (RFC 7208) and DMARC (RFC 7489).