Domains and DNS · 11 Nov 2026 · 8 min read
DNS records explained: what A, CNAME, MX and TXT records do
DNS records are the entries that tell the internet where your website and your email live. Read this before you change one.
The short answer
A DNS record is an entry in your domain's settings that says where a service for that domain lives. An A record points a name to a server address, a CNAME points one name to another name, an MX record says where email goes, and a TXT record holds text used for checks such as email authentication and domain verification.
What a DNS record is
DNS records explained in one line: each record is a name, a type and a value, and together they tell the internet where your domain's services live. DNS, the domain name system, is the lookup that turns a name such as example.com into the details a computer needs to reach it. When someone opens your site or sends you an email, software somewhere asks DNS for the matching record first.
The full set of records for a domain is called a zone. A zone is kept by a DNS host, which is not always the company where you bought the domain. The registrar holds the registration. The nameservers listed for the domain say which provider holds the zone, and only that provider's records count. This is why edits sometimes seem to do nothing: they were made in a zone that the nameservers no longer point to.
Every record also carries a TTL, a number of seconds that says how long others may keep a copy before checking again. It matters later, when you change something.
DNS records explained with a sample table
Below is a simplified zone for an imaginary business at example.com. The @ sign stands for the bare domain with nothing in front of it. The addresses are documentation examples, not real servers.
| Name | Type | Value | What it does |
|---|---|---|---|
| @ | A | 203.0.113.10 | Sends visitors who type the bare domain to a web server |
| www | CNAME | example.com | Makes www an alias of the bare domain, so both reach the same site |
| @ | MX | mail.example.net, with a preference number | Says which server accepts email for the domain |
| @ | TXT | v=spf1 followed by a sender list | Lists the servers allowed to send email as this domain |
| shop | CNAME | stores.example.net | Points a shop address to a service run by another company |
Your own table will have more lines, and the values will differ. Most of the extra lines are verification codes and email settings added when you connected a service. Before you touch any of them, copy the whole table somewhere safe.
What each record type does
A and AAAA records
An A record points a name to an IPv4 address, the numeric address of a server. An AAAA record does the same for the newer IPv6 format. If your host gives you a fixed address for your site, an A record is how your domain reaches it. Some hosts give you both kinds of address, and then you add both.
CNAME records
A CNAME record says one name is an alias for another name. Visitors are sent wherever the target name points. It suits services that tell you to point an address at their hostname, because the provider can change the underlying server address without asking you to edit anything.
The standard rule, set out in the DNS specifications, is that a name with a CNAME cannot carry other records. That is why a CNAME cannot normally sit on the bare domain, where NS and other records must live. Some DNS providers offer alias or flattening features to work around this, so check your provider's documentation.
MX records
An MX record names a server that accepts email for the domain. Each carries a preference number, and the lower number is tried first. A domain can list a main server and backups. A hosted mailbox service will give you the exact values to enter. Without correct MX records, mail to your domain bounces or goes somewhere you did not intend.
TXT records
A TXT record holds text. It has no built-in function, so other systems read it for their own purposes. The common uses are proof of ownership, where a service asks you to add a code to show you control the domain, and email authentication. SPF lists who may send mail for your domain, DKIM publishes a key that lets receivers check a message is genuine, and DMARC tells receivers what to do with messages that fail.
A domain should publish only one SPF record. RFC 7208, the SPF specification, says a receiver that finds more than one returns an error, which can break authentication. If you need to add a sender, merge it into the existing record instead of adding a second.
NS and SOA records
NS records list the nameservers that hold the zone. An SOA record is technical information about the zone itself and is managed by the DNS host. Business owners rarely edit either, and a change to NS records moves the whole zone to another provider.
A record vs CNAME: which one to use
Use an A record when you have been given an IP address. Use a CNAME when you have been given a hostname to point to. Follow the instructions of the service you are connecting, since they choose the target.
| Question | A record | CNAME record |
|---|---|---|
| What does it point to? | An IP address | Another name |
| Typical use | A main website at a fixed address | The www alias, and subdomains pointing to a hosted service |
| Allowed on the bare domain? | Yes | Not normally |
| Can share a name with MX or TXT records? | Yes | No |
| If the provider changes servers | You must update the address | The change follows automatically |
The usual mistake is adding a CNAME to a name that already has other records. Many control panels block this, and for good reason: the rules say a name with a CNAME cannot carry anything else.
How long DNS changes take
Some changes show within minutes, and others take longer. The limiting factor is the TTL. Resolvers, the lookup servers run by internet providers and others, keep a copy of a record for as many seconds as its TTL allows and do not ask again until that runs out. A longer TTL speeds up lookups but makes updates slower to appear. People call the wait propagation, but it is mostly caches expiring, and your own computer and router keep a cache as well.
Negative answers are cached too. If someone looked up a name before you created the record, the answer that it did not exist may be kept for a while, so a brand-new subdomain can work for you and not yet for others.
Changing nameservers is a bigger step than editing a record, because it moves the whole zone, and it may take longer to settle. Your registrar's documentation says what to expect for your domain extension.
For a planned change, such as moving a site to a new host, this order works well:
- Lower the TTL on the records you will change, ahead of time. Google's own advice on planned site moves also says to lower the DNS TTL in advance.
- Make the change at a quiet time of day for your business.
- Check the result from a phone on mobile data and from a second network, because each uses a different resolver.
- Once everything has settled, raise the TTL again.
Moving your website without breaking email
The commonest DNS accident is a website move that takes email down with it. Websites and mail use different records, so a move should touch only the website's.
- Copy every existing record, including TXT lines you do not recognise. Some are verification codes for services still in use.
- Test the new site on a private address first. A staging site lets you check everything before any DNS change, so DNS changes only once, at launch.
- Change only the A record, or the CNAME, that points to the website. Leave MX and TXT alone.
- If the move needs new nameservers, recreate every record in the new zone before switching, then compare the two tables line by line.
- After the change, send a test message into and out of your business address, and submit your contact form.
- Keep the old hosting live until the change has settled and mail is arriving normally.
Mistakes that cause outages
| Mistake | What happens | How to avoid it |
|---|---|---|
| Deleting MX records while tidying up | Email stops arriving | Copy the table first and ask before removing any MX line |
| Adding a second SPF record | Receivers may reject the authentication | Edit the existing record instead |
| Putting a CNAME on a name that has other records | The other records stop working, or the panel refuses it | Use an A record, or your provider's alias feature |
| Editing the wrong zone | Nothing changes | Check the nameservers first to see who holds the live zone |
| Typing the domain twice | The value ends up as mail.example.com.example.com | See if your panel adds the domain for you |
| Removing TXT lines you do not recognise | Connected services lose access or fail verification | Leave them until you know what each one does |
| Letting the domain registration or login lapse | The site and email both disappear | Keep the registrar account in the business's name with renewal reminders |
Who should control your DNS
The business should own the registrar account and know where its DNS is hosted. Developers, designers and email providers need to add records, but access can be shared without handing over ownership. Keep the registrar login in the business's own password manager, switch on two-step verification and record who has access. DNS access can redirect your website and your mail, so protect it like an admin login. The website security checklist covers account protection in more detail.
Put the arrangement in writing as well. A website development contract should say who owns the domain and who may change its records. Platforms and CMS tools often ask you to add records when you connect a domain, and the guide to what a CMS is and how to choose one describes how those systems fit in. A business that has not yet bought its domain can start with what a startup website needs first. If you want a team to handle the DNS side of a launch, the website development page from Liftup Technologies describes the work.
Related guides
- Domain name vs website vs hosting
- How to transfer a domain name step by step
- Https and ssl certificates explained
- Xml sitemap and robots txt what they do
Questions and answers
What is a DNS record?
A DNS record is an entry in your domain's settings that tells the internet where a service for that domain is. Each record has a name, a type, a value and a TTL. Together they send visitors to your website and your email to the right servers.
What do A, CNAME, MX and TXT records do?
An A record points a name to a server's IP address. A CNAME makes one name an alias of another. An MX record says which server receives your email. A TXT record holds text that other systems read, such as email authentication settings and ownership codes.
How long do DNS changes take?
From minutes to longer, depending on the TTL of the old record and on caches held by resolvers, routers and devices. Lowering the TTL before a planned change helps. Changing nameservers can take longer to settle than editing a single record.
What is the difference between an A record and a CNAME?
An A record points a name directly at an IP address. A CNAME points it at another name, which then leads to an address. A CNAME cannot share a name with other records, so it is not normally used on the bare domain.
Do I need to change DNS when I update my website?
Usually not, if the site stays on the same host. DNS changes are needed when the site moves to a new server, when you connect a new service, or when you change email provider. Editing pages or posts does not touch DNS.
Why does my domain still show the old site?
An old copy of the record is probably cached on a resolver or on your device, or you edited a zone that the nameservers do not use. Check which provider your nameservers belong to, wait for the TTL to run out and test on another network.
What is TTL in DNS?
TTL, or time to live, is the number of seconds a resolver may keep a record before asking again. A short TTL makes changes show sooner but means more lookups. A long TTL reduces lookups but slows down changes.
Tell us what you are building.
A short call, a written plan and a fixed quote. No obligation.