October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Understanding A, CNAME, and MX DNS Records: A Beginner’s Guide

A records point to IPv4 addresses, CNAMEs point to hostnames, and MX records route email. Learn how to choose provider-supplied values and avoid common DNS conflicts.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A, CNAME, and MX records answer different questions about a domain: an A record gives an IPv4 address, a CNAME points to another hostname, and an MX record directs email delivery to a mail server. The right values come from the web host or email provider you use—not from a generic example.

What does DNS do?

DNS, or the Domain Name System, lets services look up information associated with a domain name. Different record types carry different kinds of answers: some identify an address for a website, while others direct email or point one name to another. A record is not a substitute for an MX record; each serves a different purpose.

As an Amazon Associate I earn from qualifying purchases.

What is an A record?

An A record maps a DNS name to one or more IPv4 addresses. For example, a record for example.com could contain the documentation-reserved example address 192.0.2.0. That address illustrates the format only; use the address supplied by your web host. Cloudflare’s DNS record type reference describes A and AAAA records as mapping a domain name to one or multiple IPv4 or IPv6 addresses.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The corresponding record for IPv6 is AAAA. A host may provide an IPv4 address, an IPv6 address, a hostname to use instead, or more than one of these. Follow the instructions for the service and record types it supports.

What is a CNAME record?

A CNAME maps one DNS name to another hostname, rather than directly to an IP address. DNS can then follow the target name to find the address information needed for the service. For instance, a site might use www.example.com as a CNAME pointing to a hostname supplied by its web host. The target shown here is intentionally unspecified: use the exact hostname in your host’s setup instructions.

Cloudflare’s record type reference explains CNAMEs, and its CNAME troubleshooting documentation describes the name-conflict issue that can arise when other records are configured at the same name.

What does an MX record do?

An MX record identifies a mail exchanger hostname for a domain’s incoming email. It also includes a priority value so mail systems can prefer one exchanger over another. In Cloudflare’s DNS records API documentation, lower priority numbers are preferred; the record content must be a valid mail-server hostname.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

MX values are set by the email provider. A schematic record might use example.com as the name, a provider-specified mail hostname as the destination, and a priority supplied by that provider. Do not copy an MX hostname or priority from a generic tutorial. Cloudflare’s email-record setup guide likewise directs domain owners to their email provider’s setup instructions for the correct values.

How do A, CNAME, and MX records differ?

Record What it contains Typical role Important constraint
A One or more IPv4 addresses Directs a name to an IPv4 address, often for a website Multiple A records can exist at the same name.
CNAME Another hostname Aliases a name to a canonical hostname, often for a website service Under conventional DNS behavior, it generally cannot share its name with other record data.
MX A mail-server hostname and a priority Directs email delivery for the domain The email provider supplies the required hostnames and priorities.

These records are not interchangeable. A and CNAME records are commonly involved in getting a website hostname to its destination; MX records tell sending mail systems where to deliver email. A name can have different records for different purposes, but a CNAME’s same-name restriction needs special care.

Can a CNAME and an A record use the same name?

Generally, no. A CNAME at a name is expected to provide the information for that name, so placing an A record or other data there conflicts with that behavior. Cloudflare explains this restriction in its same-name DNS record troubleshooting guide. Multiple A or AAAA records can be configured at one name, but that does not mean they can be combined there with a CNAME.

Check your DNS provider’s validation and documentation if its interface offers a CNAME-like option alongside other records. Providers may implement special behavior, and their rules should not be assumed to match another provider’s.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What is the zone apex, and can it use a CNAME?

The zone apex is the domain itself, such as example.com, rather than a subdomain such as www.example.com. DNS providers commonly display the apex as @, but the control-panel notation and supported record types vary. Cloudflare’s records quick scan uses @ for the apex in its examples.

Conventional CNAME rules make a CNAME at the apex problematic because the apex also needs other DNS data. Some providers offer an implementation-specific feature to handle this. Cloudflare, for example, documents CNAME flattening for zone apex records; this is a Cloudflare feature, not a universal DNS capability. Use the approach documented by your DNS provider and the destination given by your web host.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What should your records point to?

The service you are connecting determines the destination. A web host supplies the address or hostname for website traffic; an email provider supplies the MX hostnames and priorities for mail. Cloudflare’s subdomain record guide explains when A, AAAA, or CNAME records may be appropriate. Its email record guide recommends getting MX values from the email provider.

  1. Find the service’s current DNS instructions. Use the setup information for the web host or email provider you are actually configuring.
  2. Match the requested record type. Enter an IPv4 address for A, an IPv6 address for AAAA, a hostname for CNAME, or the mail hostname and priority for MX.
  3. Enter the name in your DNS provider’s format. The apex may be represented by @; a subdomain may be entered as a full name or only its label, depending on the provider’s interface.
  4. Check for conflicting records at the same name. In particular, remove or avoid other data where a CNAME is required, unless your provider explicitly documents a special implementation.

Cloudflare’s quick-scan examples show the shape of common entries—an apex A record, a www CNAME, and an apex MX record—but these are patterns, not universal destinations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What does DNS TTL mean?

TTL, or time to live, tells resolvers how long they may cache a DNS response before checking again. A longer TTL can mean a resolver continues using a cached answer for longer; a shorter TTL allows it to check for a new answer sooner. TTL does not promise that every person will see a DNS change at exactly that time: resolvers may have cached data at different moments, and provider options and defaults vary. Cloudflare describes TTL in its DNS record type reference.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.