Login

DNS Record Types Explained (A, AAAA, CNAME, MX, TXT)

DNS Record Types Explained (A, AAAA, CNAME, MX, TXT)

Whenever you visit a site through a website, have you ever thought about how the computer understands it? You type ‘host.co.in’ on a website, but your computer remembers it as a number, which is called an ‘IP address’, and this translation is done by DNS (Domain Name System). DNS is itself a phonebook, and DNS records are different types of information stored inside that phonebook.

Most people do not need to memorise every domain name system types that exists. What actually helps is knowing which record to touch and when. If you are setting up hosting, you need an A record. If you are setting up email, you need an MX record. If a platform asks you to verify your domain, you probably need a TXT record.

This guide walks through the DNS record type examples you will actually use: A, AAAA, CNAME, MX, and TXT – in plain language, with examples, so you know exactly which one to set up and why.

What Is a DNS Record?

A DNS record is a simple instruction stored in a domain’s DNS zone file. Each one has four parts: a name, a type, a value, and a TTL (how long the instruction should be remembered before it is checked again). Just like in your contacts, you have a name, a number, and an email address for a person.

Think of DNS as the internet’s phone book. Your domain name is the person’s name, and each DNS types is a separate contact detail for that person – one number for calls, one for messages, and one for their address. The phone book (DNS) does not do anything on its own; it simply tells anyone asking where to go.

All of these records live inside something called a DNS zone, which is managed through your domain’s nameservers.

Types of DNS Records with Examples

Here is a quick-reference table before we go section by section with DNS record type examples:

Record What it does Points to Example
A Connects your domain to a server’s address An IP address (IPv4) example.com ? 192.0.2.1
AAAA Same as A, but for newer-style addresses An IP address (IPv6) example.com ? 2001:db8::1
CNAME Points one domain to another domain instead of an address Another domain name www.example.com ? example.com
MX Tells the internet where to deliver your email Your mail server example.com ? mail.example.com
TXT Stores extra text info about your domain, often for verification or security Any text example.com ? “v=spf1 include:_spf.google.com ~all”

Keep this table in mind as you read on. Each section below explains one row in more detail.

A Record (Address Record)

It links domain name types to an IPv4 address. It directs someone visiting your domain to the server. A record points a domain or subdomain directly to an IPv4 address. It’s the simplest and most common type of DNS record.

An A record typically has 3 parts: the name (what domain or subdomain it applies to), the TTL (how long it should be cached), and the value (the IP address itself).

You will use an A record when you point your root domain to a web server, when you set up a separate subdomain for a service such as blog.example.com, or when you use multiple A records for the same domain to spread traffic across servers (round-robin load balancing). If you are pointing your domain to host.co.in hosting, the A record is the one you will edit first.

AAAA Record

An AAAA record does the same job as an A record, but for IPv6 (an advanced version of IPv4)  addresses instead of IPv4. As more networks move to IPv6, having an AAAA record alongside your A record ensures your website stays reachable no matter which type of connection a visitor’s device uses.

It is worth noting that AAAA does not replace A. Most domains today run both so that visitors on either IPv4 or IPv6 networks reach the site without any issue.

CNAME Record (Canonical Name Record)

A CNAME record maps one hostname to another, instead of pointing directly to an IP address. It does not say “go to this address”; it says “go wherever this other domain points to”.

A common example is pointing www.example.com to example.com or pointing a subdomain to a CDN hostname provided by a service you use.

There is one rule worth remembering here: a canonical name record cannot be used at the root or apex domain. For the root domain, you must use an A or AAAA record instead. This trips up a lot of people setting up DNS for the first time.

DNS CNAME records are especially useful for CDN configuration and for serving multiple subdomains from one canonical source.

MX Record (Mail Exchange Record)

A mail exchange records tells the internet where to deliver email for your domain. Without it, mail sent to your domain has nowhere to go.

Imagine you have letters arriving, and the post office asks, “Which building receives mail?” MX gives that building’s address.

Each DNS MX record includes a priority value. A lower number means higher priority, so mail servers try that destination first and fall back to the next one only if it does not respond.

Domains often list more than one mail exchanger MX records for redundancy: a primary mail server and a backup, in case the primary is unavailable.

One important gotcha: the mail exchange records target must be a hostname that has its own A or AAAA record. It can never point directly to an IP address, and it can never point to a CNAME.

If you are setting up Google Workspace, Outlook, or Host.co.in email hosting for your domain, this is the record you will configure.

TXT Record (Text Record)

A TXT record stores arbitrary text tied to your domain. It does not control routing the way A or MX records do; instead, it is used to prove ownership or set rules for how your domain behaves elsewhere.

The most common uses are:

  • Domain ownership verification: platforms such as Google Search Console ask you to add a TXT rr to confirm you own the domain
  • SPF: authorises which mail servers are allowed to send email on your domain’s behalf
  • DKIM: signs outgoing email so receiving servers can confirm it was not tampered with
  • DMARC: tells receiving servers what to do with email that fails SPF or DKIM checks

Other DNS Records You Might Encounter

Beyond the five above, a few other record types show up occasionally:

  • NS (Nameserver): delegates a domain or subdomain to a specific set of nameservers
  • SOA (Start of Authority): holds administrative information about the DNS zone
  • PTR (Pointer): used for reverse DNS, mapping an IP address back to a domain name
  • SRV (Service): points to a specific server and port for a given service
  • CAA (Certification Authority Authorisation): specifies which certificate authorities are allowed to issue SSL certificates for your domain.

You do not need to configure these often, but it helps to know what they are if you come across them.

Common DNS Record Mistakes to Avoid

1. Pointing your A record to the wrong IP address

This happens during a hosting migration. You moved to a new server, but you forgot to update the A record; it still points to the old IP address. Visitors end up seeing your old website, an error page, or nothing, depending on what is still sitting at that old address. Whenever you migrate hosting, updating the A record is not optional: it is the whole point.

2. Using a CNAME DNS where an A record was needed

This is one of the most common mistakes for anyone new to DNS. People try to set up a CNAME on their root domain (example.com), not realising that most DNS providers do not allow it there, because the root domain also needs to carry other records like NS and SOA. CNAME is meant for subdomains — www, blog, and shop — not the root itself.

3. Deleting MX records by mistake

This one catches people out during a website migration. Someone thinks, “I do not use email through this domain,” and removes the MX records along with everything else. The website keeps working fine, but every email sent to an address like info@example.com bounces back because DNS no longer knows where to deliver it.

4. Small errors in TXT records

DNS record TXTs are used for things like Google Search Console verification, SPF, DKIM, and DMARC. The trouble is, they are unforgiving of small mistakes: a missing quotation mark, an extra space, or a single typo is enough to break them. When that happens, domain verification can fail, or your emails can start landing in spam instead of the inbox.

5. Adding an AAAA record without an IPv6 address to back it up

Some people add an AAAA record because it sounds like the “better” thing to do. But an AAAA record is only useful if your server actually has an IPv6 address behind it. If it doesn’t, visitors to IPv6-enabled networks can have connection issues rather than a smoother experience. You should only add an AAAA record after your hosting provider has actually given you an IPv6 address.

6. Not accounting for DNS propagation time

This is not really a configuration mistake: it is more of a misunderstanding. Someone updates their A record from an old IP to a new one, opens the website immediately, and assumes it has not worked because they are still seeing the old version. DNS changes do not happen everywhere at once. DNS servers around the world need time to refresh their caches, and depending on your TTL and your visitors’ ISPs, that can take anywhere from a few minutes to several hours.

7. Accidentally deleting DNS records

Sometimes it is simpler than a mistake in judgement: someone editing DNS accidentally removes an A record, an MX record, or a CNAME. The effects show up fast: the website stops loading, emails stop arriving, or a subdomain stops working. This is exactly why it is worth backing up your DNS zone before making any changes, so a mistake is a quick fix rather than a scramble.

How to Check Your DNS Records

You can check current DNS records for any domain either with a command-line tool like nslookup or dig or with any free DNS lookup tool online. Useful when you want to check a change has gone live, or when you are troubleshooting why an email or website is not working as expected.

If you have your domain hosted with host.co.in, you can view and edit all of these records from your DNS management panel directly without having to use any command-line tools.

FAQs about DNS record types

  • What are the 3 types of DNS records?

The three most popular types of DNS records are A, CNAME, and MX. The A record is used to point the domain to an IP address, the CNAME is used to point a domain to another domain, and the MX record is used to point the email to the right mail server.

  • What is the difference between an A record and a CNAME record?

An A record points straight to an IP address. A CNAME record points to another domain name, which then resolves to an IP address of its own. CNAME records cannot be used at the root domain. An A record can be.

  • Why do MX records have priority numbers?

Priority numbers tell mail servers what destination to try first. The lower number is attempted first, and higher numbers are used as backups if the primary server is non-responsive.

  • Can I use a CNAME record on my root domain?

No. You cannot use CNAME records at the root (also called apex) domain. CNAME for subdomains only. For the root domain, you should use an A or AAAA record.

  • What is a TXT record?

You can use TXT records to add text information to a domain. Most commonly used to validate domain ownership and configure SPF, DKIM, and DMARC records to authenticate emails.

Conclusion

Five DNS record types cover almost everything a website owner will ever need to touch: A, AAAA, CNAME, MX, and TXT. Once you know what each one does, setting up hosting, email, or domain verification stops feeling like guesswork.

If you need help configuring any of these for your domain, Host.co.in’s DNS management tools and support team are available to walk you through it.

Prathamesh Suryawanshi

DNS Record Types Explained (A, AAAA, CNAME, MX, TXT)
Table of Contents

    You May Also Like

    ×