“Do I need to buy web hosting just to get an email address like name@yourcompany.in?” It is one of the most common questions we get from small businesses, and the honest answer is: no, but you do need a domain, and the email has to be hosted somewhere. This guide explains the three pieces involved, […]
DNS Records Explained: A, CNAME, MX, TXT and More (With Examples)
Every domain has a small set of instructions stored in DNS that tell the internet where to find its website, where to deliver its email and who is allowed to send mail or issue certificates for it. Those instructions are called DNS records. You rarely need more than six types, and once you know what each one does, most “my site is down” and “my email is not arriving” problems become easy to diagnose.
This guide explains the common record types in plain language, with an example of each, and lists the mistakes we see most often when businesses edit DNS themselves.
Where your DNS records live
Your DNS records are stored with whichever company your domain’s nameservers point to. That might be your registrar, your web host or a DNS service. If you are not sure, look up the domain’s nameservers first: editing records at a company that is not your active DNS host changes nothing. Our guide to pointing your domain to your hosting explains nameservers versus individual records.
A record: where your website lives (IPv4)
An A record maps a name to an IPv4 address. It is the record that sends visitors to your web server.
yourcompany.in A 203.0.113.10
Change it when you move your website to a new server. Most sites have one A record for the root domain and either another A record or a CNAME for www.
AAAA record: the same thing for IPv6
An AAAA record does exactly what an A record does, but for an IPv6 address. Only add one if your server really has an IPv6 address; a wrong AAAA record makes the site fail for visitors whose networks prefer IPv6, which looks like a random, intermittent outage.
CNAME record: an alias to another name
A CNAME points one name at another name instead of at an IP address. A typical use is making www follow the root domain, or pointing a subdomain at an external service.
www.yourcompany.in CNAME yourcompany.in
Two rules: a name that has a CNAME cannot have any other record, and the root domain itself (yourcompany.in) normally cannot be a CNAME, because it must also hold MX, NS and other records.
MX record: where your email is delivered
MX records tell other mail servers where to deliver email for your domain. Each one has a priority number; the lowest number is tried first, and the others are backups.
yourcompany.in MX 10 mail.yourcompany.in
MX records are completely separate from your A record. That is why you can have business email without a website, and why you should leave MX records alone when you only change web hosts. Read more on business email hosting.
TXT record: SPF, DKIM, DMARC and verification
TXT records hold text that other systems read. Three of them decide whether your email lands in the inbox or in spam:
- SPF lists the servers allowed to send mail for your domain, for example
v=spf1 include:_spf.example.com ~all. A domain should have only one SPF record; two SPF records cause both to fail. - DKIM publishes a public key (usually at a name like
default._domainkey) so receivers can check your mail was not altered. - DMARC (at
_dmarc.yourcompany.in) tells receivers what to do with mail that fails SPF and DKIM, and where to send reports. Start withp=none, read the reports, then tighten.
TXT records are also how services such as Google Workspace or Search Console verify that you own a domain.
NS record: who answers for your domain
NS records name the nameservers that hold all the other records. You set them at your registrar. Changing nameservers moves your whole DNS zone, so copy every existing record (especially MX and TXT) to the new DNS host before you switch.
CAA record: who may issue SSL certificates
A CAA record lists the certificate authorities allowed to issue SSL certificates for your domain. It is optional, but if you add one, make sure it includes the authority your SSL certificate comes from, or renewals will be refused.
What TTL means and what value to use
Every record has a TTL (time to live) in seconds: how long other resolvers may cache the answer. 3600 (one hour) is a sensible everyday value. A day before a planned change, such as moving to a new server, lower the TTL of the records you will change to 300 so the switch spreads quickly; raise it again afterwards. Changes can still take a while to appear everywhere, which our article on DNS propagation explains.
Quick reference
| Record | Points to | Used for |
|---|---|---|
| A | IPv4 address | Website / server |
| AAAA | IPv6 address | Website over IPv6 |
| CNAME | Another hostname | www, subdomains, external services |
| MX | Mail server hostname + priority | Incoming email |
| TXT | Text | SPF, DKIM, DMARC, ownership verification |
| NS | Nameserver hostnames | Which DNS host is authoritative |
| CAA | Certificate authority | Restricting SSL issuance |
Six DNS mistakes that break websites and email
- Editing records at the wrong company because the nameservers point somewhere else.
- Changing nameservers without copying MX and TXT records, so email stops the moment the switch completes.
- Two SPF records instead of one combined record.
- A leftover AAAA record pointing to an old server after a migration.
- A CNAME on a name that also has other records, which most DNS hosts reject or resolve unpredictably.
- Forgetting to lower the TTL before a move, so visitors keep reaching the old server for hours.
Moving hosts soon? Use our website migration checklist. Need a domain or hosting with DNS management included? See domain registration and shared hosting plans.
Frequently asked questions
How long do DNS records take to update?
The change is saved at your DNS host immediately. Other networks see it once their cached copy expires, which depends on the record’s previous TTL. With a one-hour TTL most visitors see the change within an hour or two; nameserver changes can take up to 24 to 48 hours.
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 a name at another name, which then resolves to an IP address. Use A for the root domain and CNAME for aliases such as www.
Can I have more than one MX record?
Yes. Mail servers try the lowest priority number first and fall back to the others. Only list servers that are actually set up to accept your mail.
Will changing my A record affect my email?
No, as long as your MX records point to a mail server name that does not depend on the A record you changed. If your MX points to mail.yourcompany.in, check where that name points before and after the move.
