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

What DNS is, what each common record type does, how changes propagate and how to update DNS safely when moving websites or email.

By the UK Technology Hub teamPublished 4 minute read

The short answer

DNS is the internet's address book: it turns domain names into the server addresses that browsers and email systems need. Different record types do different jobs: A and AAAA point to servers, CNAME points one name to another, MX handles email, and TXT stores verification and email security settings. Most outages during website moves come from DNS mistakes, so record your existing settings before changing anything.

Every time someone visits your website or sends you an email, the Domain Name System (DNS) works behind the scenes to find the right server. You rarely think about DNS until something breaks, usually during a website launch, hosting move or email change. Understanding the basics prevents most problems.

Nameservers: who's in charge

Your domain's nameservers decide which provider manages its DNS records. They're set at your domain registrar. They might point to your registrar, your hosting company, a DNS provider or a platform like Cloudflare or Vercel. Changing nameservers moves control of all records to the new provider, so copy existing records first.

The common record types

RecordWhat it doesExample use
APoints a name to an IPv4 addressexample.com to your web server
AAAAPoints a name to an IPv6 addressIPv6 version of the above
CNAMEPoints one name to another namewww to your hosting platform's domain
MXSays which servers receive emailGoogle Workspace or Microsoft 365 mail servers
TXTStores text for verification and policiesSPF, DKIM, DMARC, site verification
NSLists the nameservers for the domain or a subdomainDelegating DNS
CAASays which authorities can issue SSL certificatesLimiting certificate issuers
SRVPoints to specific servicesSome communication and calendar tools

A and CNAME records for websites

The root domain (example.com) usually uses A records pointing to your host's IP addresses, or a provider-specific alternative. Subdomains like www often use a CNAME pointing to the host's domain. You can't normally put a CNAME on the root domain alongside other records, which is why hosts give separate instructions for the root and www.

Decide which version is your main address, with or without www, and redirect the other to it.

MX and TXT records for email

MX records route incoming email to your email provider. TXT records hold email authentication:

  • SPF lists services allowed to send email for your domain.
  • DKIM publishes keys used to verify email signatures.
  • DMARC sets a policy for failed checks and sends reports.

Getting these right improves delivery and protects against impersonation. Website forms that send email also rely on them; see our guide to fixing a contact form that isn't sending email.

TTL and propagation

Each record has a time to live (TTL), telling other systems how long to cache it. After a change, some visitors may see the old value until caches expire. That's what people mean by "propagation." Changes often take effect within minutes to a few hours, but nameserver changes can take longer.

Tip: lower the TTL a day before a planned change, then raise it again afterwards.

Changing DNS safely

  1. Export or screenshot all current records before touching anything.
  2. Identify what each record does: website, email, verification, third-party services.
  3. Lower TTLs ahead of the change.
  4. Recreate all records at the new provider before switching nameservers.
  5. Make the change at a quiet time.
  6. Test the website, email sending and receiving, and any services relying on DNS.
  7. Check SSL certificates issue correctly on the new setup.
  8. Restore normal TTLs.

Common mistakes

  • Switching nameservers and losing MX records, breaking email.
  • Deleting verification TXT records that services still need.
  • Multiple SPF records, which breaks SPF.
  • Forgetting the www or root version.
  • Typos in record values.

Checking DNS yourself

Free online DNS lookup tools show what records the world currently sees for your domain. Use them before and after changes to confirm records are correct. Command-line tools give the same information for technical users. If a site shows security warnings after a move, our guide to fixing mixed content warnings covers a related set of HTTPS issues.

DNS and performance

DNS providers with global networks resolve names quickly, and many CDNs include DNS. Our CDN guide explains how DNS and CDNs often work together.

Security

Protect your registrar and DNS accounts with strong passwords and two-factor authentication. Someone who controls your DNS controls your website and email. Consider DNSSEC where supported, and CAA records to limit who can issue certificates.

How we help

Our web development team handles DNS changes during launches and migrations without downtime, our maintenance plans include DNS and email authentication checks, and our web app team configures DNS for custom applications and APIs.

Frequently asked questions

How long do DNS changes take?

Often minutes to a few hours, depending on TTL settings. Nameserver changes can take longer.

Will changing DNS affect my email?

It can, if MX and email TXT records aren't recreated correctly. Always copy existing records first.

What's the difference between an A record and a CNAME?

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

This guide is general information, not legal, tax or financial advice, and details such as prices, features and rules can change. Product and company names mentioned are trademarks of their respective owners and are used only to identify those products; UK Technology Hub is not affiliated with or endorsed by them.

Related guides

All websites & web design guides