DNS Records Explained: A, CNAME, MX, and TXT Records for Your Domain
DNS records are the settings that tell the internet where your domain should send web traffic and email. The five you actually touch are the A record (points the domain at your website's IP address), the CNAME record (aliases one name to another, used for www and most third-party services), the MX record (routes email to your mail provider), the TXT record (holds verification strings and email security like SPF, DKIM, and DMARC), and the NS record (names the servers that answer for your domain). You edit them in your registrar or DNS provider's dashboard, and most changes take effect within an hour. This guide explains what each record does, in plain language, so you can set up a domain you just bought without guessing.
Get the name first, point it wherever you want
Browse premium domains with published prices and escrow-backed checkout.
What are DNS records?
DNS records are individual instructions stored in your domain's zone file that tell the rest of the internet where to send different kinds of traffic. When someone types your domain, their computer asks the domain name system (DNS) for the matching record, gets an answer such as an IP address, and connects. Each record has a type (A, CNAME, MX, and so on), a name (the domain or subdomain it applies to), a value (where it points), and a TTL (how long other servers cache it). Think of the zone file as a switchboard: web visitors follow one record, email follows another, and verification tools follow a third, all under the same domain.
What are the main types of DNS records?
Most domains run on five record types. You will rarely need more than these unless you add advanced email security or a special service.
| Record | What it does | Points to | You use it for |
|---|---|---|---|
| A | Maps the domain to an IPv4 address | An IP like 192.0.2.1 | Your website's server |
| AAAA | Same as A, but for IPv6 | An IPv6 address | Modern hosts that support IPv6 |
| CNAME | Aliases one name to another name | Another hostname | www, and services like Shopify or a page builder |
| MX | Routes email to a mail server | A mail host, with a priority number | Google Workspace, Microsoft 365, other email |
| TXT | Holds plain-text values | A string of text | Domain verification, SPF, DKIM, DMARC |
| NS | Names the authoritative servers | Nameserver hostnames | Delegating who answers for the domain |
What is an A record?
An A record maps your domain to an IPv4 address, which is the numeric address of the server that holds your website. It is the record that turns yourname.com into an actual page in a browser. Every live site needs at least one A record, usually on the bare domain (yourname.com) pointing at your host's IP. Its IPv6 twin, the AAAA record, does the same job with a newer IPv6 address; add it when your host gives you one, but the A record is the one that matters first.
What is a CNAME record?
A CNAME record makes one name an alias for another name instead of pointing directly at an IP address. The classic example is www: a CNAME on www.yourname.com pointing at yourname.com means the two always resolve to the same place, so you only update the address in one spot. CNAMEs are also how most third-party platforms hook up a custom domain, whether that is a store, a landing-page builder, or an email marketing tool that asks you to add a CNAME to verify. One rule trips people up: you cannot put a CNAME on the bare root domain in classic DNS, which is why the root uses an A record and www uses a CNAME.
What is an MX record?
An MX (mail exchange) record tells the internet which server should receive email for your domain, and it is completely separate from your website. You can host a site at one company and run email at another because the A record and the MX record are independent. Each MX record carries a priority number, and lower numbers are tried first, which is how providers set a primary and a backup mail server. When you sign up for Google Workspace or Microsoft 365, they hand you a set of MX records to paste in; get those wrong and mail silently fails to arrive, which is the single most common DNS mistake after buying a domain.
What is a TXT record?
A TXT record stores a plain-text value, and its two biggest jobs today are proving you own the domain and protecting your email. Services verify ownership by asking you to add a short TXT string they generate. Email security uses three specific TXT records: SPF lists which servers are allowed to send mail as your domain, DKIM adds a cryptographic signature so receivers can confirm messages were not tampered with, and DMARC tells inbox providers what to do with mail that fails those checks. If you run any email from the domain, those records are what keep your messages out of the spam folder, so a tool that helps you send outreach and protect your sending reputation only works if the SPF and DKIM TXT records are in place first.
What is an NS record?
An NS (nameserver) record names the authoritative servers that answer DNS questions for your domain. When you buy a name, the registrar sets NS records pointing at its own nameservers, and those servers hold your zone file with all the records above. If you move DNS management to another provider, such as Cloudflare, you change the nameservers rather than the individual records. That is a bigger switch than editing one record, and it is worth understanding on its own; our guide to domain nameservers covers exactly how and when to change them.
What is TTL in a DNS record?
TTL (time to live) is the number of seconds that other servers are allowed to cache a record before checking again, and it controls how fast a change spreads. A TTL of 3600 means resolvers hold the old value for up to an hour after you edit it; a TTL of 300 means five minutes. When you plan to change a record, lower its TTL a day ahead so the switch propagates quickly, then raise it back afterward to cut needless lookups. TTL is why a DNS edit is rarely instant and why you should test in a private browser window rather than assuming a change failed.
How do I edit DNS records after buying a domain?
You edit records wherever your domain's DNS is managed, which by default is your registrar. The dashboard names vary, but the flow is the same everywhere.
- Open the DNS or zone settings for the domain in your registrar or DNS provider.
- Add or edit the record you need: an A record for the site, a CNAME for www, MX records for email, TXT records for verification and security.
- Enter the exact value your host or email provider gave you, with no extra spaces or trailing dots unless specified.
- Save and wait. Record changes usually take effect within minutes to an hour, though full propagation can run to 48 hours.
- Test it in a private window, and if the site or email should now be live, confirm it stays reachable rather than checking once and moving on. A simple uptime check that pings the site every minute catches a bad record before your visitors do.
If your goal is simply to make the domain load your website, the shortest path is in our guide on how to point a domain name to a website. If you only want it to bounce visitors to another site, see URL forwarding instead.
Do I need DNS records if I only bought the domain to hold it?
No. A domain you are holding as an investment or a defensive name needs nothing beyond staying registered and renewed; the registrar's default records are fine and it will simply show a parking page. DNS records only matter once you want the name to do something, whether that is serving a website, running email, or forwarding to another address. This is why buying a good name early is low risk: you can sit on it with no setup and wire it up the day you are ready. If you are still choosing between names, our guide to how many domains to buy keeps the bill sensible.
The bottom line on DNS records
DNS records look intimidating until you see that each one has a single job. The A record sends web visitors to your server, the CNAME keeps www and third-party services in sync, the MX record delivers your email, the TXT records verify ownership and protect deliverability, and the NS records decide who runs the whole zone. Set the ones you need, respect the TTL when you make a change, and test before you assume anything broke. When you are ready for the name itself, browse our brandable names for sale or read how much a domain name costs before you buy.
Looking for a premium domain?
Browse 470+ hand-picked, brandable domain names. Buy instantly or lease to own, with every payment secured by Escrow.com.
Browse Premium Domains