Skip to content

Home / Blog

Explainer

DNS Records Explained Simply: A, CNAME, MX and TXT

DNS Records Explained Simply: A, CNAME, MX and TXT

DNS records are short instructions stored with your domain that tell the internet where your website lives, where your email should be delivered and who can prove they own the domain. Here are the main DNS records explained in one line each: an A record points a name to a server’s IP address, a CNAME makes one name follow another, an MX record names your mail server, and a TXT record holds verification codes and email security settings.

Most people meet DNS when a developer asks for a CNAME, Google wants a TXT record, or email stops after a site move. This guide covers each record with an example, where to edit them, TTL, and the mistakes that break sites and inboxes.

What are DNS records, and how do you read one?

The Domain Name System (DNS) is the internet’s directory: it turns a name like example.com into a numeric address computers can use. Every domain has a DNS zone, a list of records, and each record answers one question: where is the website, where does email go, who manages this list?

Every record has four fields, whatever control panel you use:

Field What it means Example
Name (or Host) The part before your domain; @ means the domain itself @, www, shop
Type The kind of record A, CNAME, MX
Value (or Target) What the record points to 192.0.2.10 or mail.example.com
TTL How long, in seconds, others may cache the answer 3600

example.com and 192.0.2.10 are reserved for documentation; use your own domain and your provider’s values.

Where do you edit DNS records?

You edit records wherever your domain’s nameservers point, which is not necessarily the company you bought the domain from. Getting this right solves half of all DNS problems.

Nameservers are the servers responsible for your domain’s DNS zone. There are three common setups:

  1. Nameservers point to your hosting company: edit records in your hosting panel. In cPanel this is usually the Zone Editor.
  2. Nameservers belong to your domain registrar: edit records in the registrar’s domain panel.
  3. Nameservers belong to a separate DNS service such as Cloudflare: edit records there and only there.

Changes made anywhere else have no effect. To see your current nameservers, run:

nslookup -type=ns example.com

For the two ways of connecting a domain to hosting (changing nameservers or changing only the A record), see domain vs hosting vs website.

DNS records explained: what does each type do?

There are many record types, but a typical business only needs about seven. Here is what each does, with examples.

A record: from a name to a server address

An A record points a name to the IPv4 address of the server that hosts your site. It is the record that actually brings visitors to your website.

  • Example: name @, type A, value 192.0.2.10.
  • Meaning: anyone asking for example.com is sent to server 192.0.2.10.

When you move hosts, changing this record is the moment visitors start reaching the new server.

AAAA record: the same idea for IPv6

An AAAA record does the same job for IPv6 addresses such as 2001:db8::10. An old AAAA record left pointing at a previous server sends some visitors there, so update A and AAAA together when you move.

CNAME record: one name follows another

A CNAME record makes a name an alias of another name, so it takes its address from that name. If the original name’s address changes, the alias follows automatically.

  • Example: name www, type CNAME, value example.com.

CNAMEs come with strict rules that cause many errors:

  • A CNAME points to a hostname, never to an IP address.
  • A name with a CNAME cannot hold any other record, as RFC 2181 states. Because the bare domain (@) always carries NS and SOA records, you cannot put a CNAME there. Some DNS providers offer an ALIAS or ANAME record for this case.

MX record: where your email is delivered

An MX record names the server that receives mail for addresses at your domain, such as info@example.com. Each MX record has a priority number, and in the original DNS specification lower values are preferred.

  • Example: @, MX, priority 10, mail.example.com.
  • Backup: @, MX, priority 20, mail2.example.com, used only if the first cannot be reached.

The value of an MX record must be a hostname with its own A or AAAA record, not an IP address, and RFC 2181 forbids it from being a CNAME alias. If you move email to a service such as Google Workspace or Microsoft 365, replace the old MX values with theirs.

TXT record: verification and email security

A TXT record holds free text that other services read. It has two main jobs:

  1. Proving you own the domain: services such as Google Search Console ask you to add a TXT record with a specific value.
  2. Protecting your email from spoofing: SPF lists the servers allowed to send as your domain, DKIM publishes the key used to sign your messages (on a name like default._domainkey), and DMARC tells receivers what to do with fakes (on the name _dmarc).

The rule many people trip over: a domain may have only one SPF record. If two records start with v=spf1, the SPF check fails with a permanent error. Merge your senders into one record instead. SPF, DKIM and DMARC are covered step by step in our guide to business email on your own domain.

NS record: who manages your records

An NS record names the nameservers responsible for your domain. Changing nameservers moves the whole zone, so old records stop working unless you recreate them in the new place.

Other records you may see

  • SOA: an administrative record created automatically with zone details; you rarely touch it.
  • CAA: lists the certificate authorities allowed to issue SSL certificates for your domain. Add one that leaves out your host’s authority and certificate renewals can fail.

What is TTL, and what should it be?

TTL (time to live) is the number of seconds resolvers around the world may keep a cached copy of a record before asking again. 3600 means one hour; 300 means five minutes.

  • Day to day: 3600 or more is fine and reduces lookups.
  • Before a planned change such as a site move: lower TTL to 300 about a day ahead so the change spreads quickly when you make it. This step is part of migrating WordPress without downtime.
  • Once things are stable: raise TTL back to its usual value.

Lowering TTL only works once the old TTL has expired, so if it was 86400 (a day), lower it at least a day ahead.

A complete example for a small business

This is what the zone might look like for a business hosting its site and email with the same provider:

Name Type Value Purpose
@ A 192.0.2.10 Website
www CNAME example.com www version of the site
mail A 192.0.2.10 Mail server name
@ MX (10) mail.example.com Receive email
@ TXT v=spf1 a mx ~all SPF: who sends as you
default._domainkey TXT v=DKIM1; k=rsa; p=… DKIM signature
_dmarc TXT v=DMARC1; p=none; rua=mailto:… DMARC policy
@ TXT google-site-verification=… Google verification

Real SPF and DKIM values come from your email provider; do not copy these.

Common DNS mistakes and how to avoid them

  1. Editing in the wrong place. Check NS first.
  2. Two A records for one name (old and new server), so visitors land on either. Delete the old one.
  3. A CNAME on the bare domain, or next to other records on the same name. Use an A record for the bare domain.
  4. MX pointing to an IP address or a CNAME. Point it to a hostname that has an A record.
  5. Two separate SPF records after adding a new email service. Merge them.
  6. Losing email records when changing nameservers. Copy every record before you switch.
  7. Doubling the domain name: typing mail.example.com in the name field when the panel appends the domain automatically, producing mail.example.com.example.com. cPanel, for one, adds the domain for you, so type just mail.

How do you check your domain’s records?

The command line shows what the world actually sees, not just what you typed into a panel:

Run nslookup example.com for the website address, nslookup -type=mx example.com for mail servers and nslookup -type=txt example.com for TXT records. On macOS and Linux, dig example.com MX +short works too. If your site will not load at all and you cannot tell whether DNS or hosting is to blame, start with our website not loading diagnosis.

When you register a domain with Start Bigger, it is registered in your own name through an ICANN-accredited registrar, and annual hosting plans include a free .com for the first year (premium domains excluded) plus free SSL for every domain and subdomain. Our support, in Arabic and English, covers DNS, email and SSL issues, so if a service asks you for a record you do not understand, send it to us on WhatsApp or in a ticket and we will help you put it in the right place.

In short

  • DNS records tell the internet where your site is (A, AAAA), where your email goes (MX) and who can verify or send as your domain (TXT).
  • Edit records where your nameservers point; anywhere else has no effect.
  • A CNAME points to a name, not an IP, cannot sit on the bare domain, and MX must never point to a CNAME.
  • Keep one SPF record per domain, and copy every record before changing nameservers.
  • Lower TTL before a planned change and raise it again afterwards.

Frequently asked questions

Can I break my website by editing DNS records?

Yes. A wrong A or MX record can take your site or email offline until you fix it. Copy or screenshot your current records before changing anything and change one record at a time. If something goes wrong, restoring the old value fixes it once the TTL has passed.

What does @ mean in DNS records?

The @ symbol stands for the bare domain itself, so example.com rather than www.example.com. Some control panels show it as an empty name field or write the full domain instead; the meaning is the same.

Do I need a separate record for www?

Usually, yes. www.example.com is a separate name in DNS, so without its own A or CNAME record it will not load. The common setup is a CNAME for www pointing to the bare domain, with the website redirecting visitors to one preferred version.

I added a record. Why is nothing happening?

The most common reason is that you edited records somewhere other than where your domain's nameservers point. The second is caching: some resolvers keep the old answer until its TTL runs out.

Can a domain have more than one TXT record?

Yes. A domain can hold several TXT records for different purposes, such as Google verification and SPF. The one important limit is that it may have only one SPF record, the one starting with v=spf1.

Read next

Jordan & Gulf

Does Server Location Matter? Germany, the Gulf and Speed

An honest look at what a server in Germany means for visitors in Jordan and the Gulf: what distance really adds, when it matters, how caching and a CDN reduce it, and how to measure it yourself.

Ready to start, or have a question first?

We answer on WhatsApp Saturday to Thursday, 9:00 am – 9:00 pm Amman time (GMT+3)

WhatsApp