WhatIP
DNS Record Types Explained: A, AAAA, CNAME, MX, TXT, and NS
When you type a domain name into your web browser, a complex set of background operations occurs within seconds to route you to the correct server. At the core of this system is the Domain Name System (DNS), often described as the phonebook of the internet.
DNS relies on various DNS record types to translate human-friendly domain names into machine-readable IP addresses and manage server directives. Whether you are setting up a website, configuring custom email addresses, or diagnosing connectivity using a public IP address lookup tool, understanding the fundamental DNS record types is essential.
This guide breaks down the six most crucial DNS records: A, AAAA, CNAME, MX, TXT, and NS.
1. A Record (Address Record)
The A Record is the most basic and critical DNS record type. It maps a domain or subdomain directly to a 32-bit IPv4 address.
-
Purpose: Points a hostname to an IPv4 host.
-
Example Value:
192.0.2.1
When a user types your domain name into their browser, the DNS resolver queries the A record to find the exact numerical IPv4 address of the web server hosting your site.
Example:
example.com$\rightarrow$A$\rightarrow$192.0.2.1
2. AAAA Record (IPv6 Address Record)
The AAAA Record (pronounced “quad-A”) serves the exact same function as an A record, but it maps a domain name to a 128-bit IPv6 address.
-
Purpose: Points a hostname to an IPv6 host.
-
Example Value:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
With the global depletion of IPv4 addresses, IPv6 adoption is steadily increasing. Adding an AAAA record ensures your website is accessible to users visiting via modern IPv6 network infrastructure.
3. CNAME Record (Canonical Name Record)
A CNAME Record acts as an alias. Instead of mapping a domain name to an IP address, it points a subdomain to another domain name.
-
Purpose: Aliases one hostname to another hostname.
-
Example Value:
blog.example.com$\rightarrow$example.com
When to use CNAME:
CNAME records are useful when running multiple services (like a blog, shop, or support portal) under different subdomains while hosting them on a single primary domain or external service (such as Shopify, GitHub Pages, or Medium).
Important Rule: A CNAME record cannot coexist with another record for the same hostname. Therefore, you should never place a CNAME record at the root/naked domain level (
example.com).
4. MX Record (Mail Exchange)
The MX Record tells the internet which mail servers are responsible for accepting incoming email messages on behalf of your domain.
-
Purpose: Routes incoming emails to the correct mail server.
-
Example Value:
10 mail.example.com
Priority Numbers in MX Records
MX records include a preference/priority integer. Lower numbers indicate higher priority. If the primary mail server is unreachable, sending mail servers will attempt delivery to the server with the next lowest priority number.
| Priority | Hostname | Destination Mail Server |
| 10 (Primary) | @ |
ASPMX.L.GOOGLE.COM |
| 20 (Secondary) | @ |
ALT1.ASPMX.L.GOOGLE.COM |
5. TXT Record (Text Record)
A TXT Record allows domain administrators to attach arbitrary human-readable and machine-readable text to a DNS zone.
While originally intended for notes, TXT records are now vital for domain ownership verification and email security protocol enforcement.
-
Purpose: Stores text-based information for external services and security checks.
-
Key Uses:
-
SPF (Sender Policy Framework): Specifies which mail servers are authorized to send email on behalf of your domain.
-
DKIM (DomainKeys Identified Mail): Adds a cryptographic signature to outgoing emails to prevent tampering.
-
DMARC: Defines how receiving servers should handle emails that fail SPF or DKIM checks.
-
Google Search Console / Third-Party Verification: Proves domain ownership by adding a unique text string.
-
6. NS Record (Name Server Record)
The NS Record specifies which DNS servers are authoritative for a domain. It delegates a DNS zone to use specific name servers.
-
Purpose: Identifies the primary and secondary name servers handling DNS queries for your domain.
-
Example Value:
ns1.hostingprovider.com,ns2.hostingprovider.com
When you purchase a domain from a registrar and host it elsewhere, you update your domain’s NS records to point to your hosting provider’s authoritative name servers.
Summary Comparison of Primary DNS Records
| Record Type | Translates / Points To | Typical Use Case |
| A | IPv4 Address (192.0.2.1) |
Pointing a domain to a web server |
| AAAA | IPv6 Address (2001:db8::1) |
Modern IPv6 web hosting routing |
| CNAME | Hostname (example.com) |
Creating domain aliases for subdomains |
| MX | Mail Server Hostname | Directing incoming domain emails |
| TXT | Text String | Email security (SPF/DKIM) & verification |
| NS | Authoritative Name Server | Zone delegation to DNS providers |
Check records instead of guessing
DNS can be confusing when one record is correct but another is missing. Use the DNS Lookup tool to inspect the records returned for a domain.
Conclusion
Understanding these fundamental DNS record types allows you to manage web hosting transitions, set up custom email infrastructure, verify third-party services, and secure your domain against email spoofing.
For more networking tools, IP diagnostics, and domain utility guides, explore our main tools on the WhatIP Homepage.