Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Published
13 min readView as Markdown

What DNS is (explained in very simple terms)

“DNS is phonebook of the internet” translating human readable domain names to machine readable IP address. It helps users to access website using memorable names instead of IP address. While we humans find it easy to remember names like google.com or chaicode.com, computers are much pickier—they communicate using numbers called IP addresses (like 192.168.1.1 or more complex strings).

Why DNS records are needed

Think of the internet like a massive, global city. While humans navigate by names (like "https://www.google.com/url?sa=E&source=gmail&q=google.com"), the infrastructure itself only understands coordinates (IP addresses like 142.250.190.46).

DNS (Domain Name System) records are the essential translation files that bridge this gap. Without them, you would have to memorize a string of numbers for every website you wanted to visit

What an NS Record is (who is responsible for a domain)

While the A record tells you where a house is, the NS (Name Server) Record tells you who holds the official map to the entire neighborhood.

In short, NS records specify which DNS servers are the "authoritative" source for your domain. They tell the rest of the internet: "If you want to find anything related to this domain (IPs, emails, etc.), go ask these specific servers."

An A Record (short for Address Record) is a fundamental part of the Domain Name System (DNS) that links a domain name to its IPv4 address — the numerical address computers use to find and communicate with each other over the internet.

What an A Record Does

  • It maps a human-friendly domain name (like example.com) to a machine-friendly IPv4 address (like 192.0.2.1).

  • When you type a domain into a browser, your device asks DNS servers for the A record to get the correct IP address and then connects to that server.

Why It Matters

  • Computers communicate using numbers (IP addresses), but humans prefer easy-to-remember names. The A record bridges that gap.

  • Without an A record, your domain wouldn’t know where to send web traffic, and the website wouldn’t load.

What an AAAA Record is (domain → IPv6 address)

An AAAA Record (pronounced “quad-A” record) is a specific type of DNS (Domain Name System) record that maps a domain name to an IPv6 address — the modern numerical address format used on the internet.

What an AAAA Record Does

  • It links a domain or hostname (like example.com or www.example.com) to a 128-bit IPv6 address (for example 2001:0db8:85a3::8a2e:0370:7334).

  • When a device looks up your domain, DNS can return this IPv6 address so the device knows where to connect over an IPv6 network.

Why It Matters

  • IPv6 is the successor to IPv4 and provides a vastly larger pool of IP addresses — important as the internet grows and IPv4 addresses become scarce.

  • AAAA records allow your domain to be reachable by clients that use IPv6 networking.

  • They work similarly to A records, but specifically for IPv6 instead of IPv4.

What a CNAME Record is (one name pointing to another name)

A CNAME Record (short for Canonical Name record) is a type of DNS (Domain Name System) record that lets one domain name act as an alias for another domain name instead of pointing directly to an IP address.

What a CNAME Record Does

  • A CNAME record maps one hostname (alias) to another hostname (the canonical or true name).

  • When someone looks up a domain with a CNAME, the DNS resolver follows that alias and continues the lookup using the target domain’s records (like its A or AAAA records), eventually returning an IP address.

  • In practice, this means the alias domain resolves to the same destination as the canonical name, without having to duplicate IP addresses in multiple places.

What an MX Record is (how emails find your mail server)

An MX Record (short for Mail exchange Record) is a type of DNS (Domain Name System) record that tells the internet where to deliver email for a domain — i.e., which mail server(s) handle incoming email for addresses at that domain.

What an MX Record Does

  • Routes email: When someone sends an email to you@yourdomain.com, the sending mail server looks up the MX records for yourdomain.com to find the correct mail server(s) that accept email for that domain.

  • Points to mail servers: An MX record doesn’t contain an IP address directly — it points to a hostname (like mail.yourdomain.com) that must have an A or AAAA record pointing to the actual IP.

What a TXT Record is (extra information and verification)

A TXT Record (short for Text Record) is a flexible type of DNS (Domain Name System) record that lets you attach arbitrary text information to a domain name — instead of pointing to an IP address like A/AAAA records do.

What a TXT Record Is

  • It is a DNS record that contains human-readable or machine-readable text associated with your domain.

  • There are no strict formatting rules for the text, though individual strings are typically limited to 255 characters (longer values can be split).

🧠 What It’s Used For

TXT records don’t direct traffic — instead, they provide extra information or instructions that outside services can read. Common uses include:

Domain & Service Verification

  • Many services (like search engine tools, hosting platforms, email providers) ask you to add a TXT record with a verification code to prove you control the domain.

Email Authentication & Security

TXT records are widely used to help email systems verify messages and prevent abuse:

  • SPF (Sender Policy Framework): Lists which mail servers are authorized to send email for your domain.

  • DKIM (DomainKeys Identified Mail): Stores a cryptographic public key that receiving servers use to verify that emails weren’t tampered with and really came from your domain.

  • DMARC (Domain-based Message Authentication, Reporting & Conformance): Defines policies for how receiving mail servers should handle messages that fail SPF/DKIM checks and can generate reports, and this policy is published via TXT record.

DNS Starts With Authority — NS & SOA Records

Before anything else, the DNS system needs to know which servers hold the records for your domain:

  • NS (Name Server) records tell the world which DNS servers are authoritative for your domain — the ones that actually hold its DNS records.

  • SOA (Start of Authority) holds administrative info like the primary server and versioning for updates.

    When you enter a domain (like example.com), the resolver first finds the NS records so it knows where to ask for details.


A / AAAA Records — Get the Website’s IP Address

Once the authoritative DNS server is found:

  • A records return an IPv4 address (e.g., 192.0.2.1).

  • AAAA records return an IPv6 address (e.g., 2001:db8::1).

    These are the core entries that let browsers locate your web server. Without these, the domain would not resolve to a server on the internet.


CNAME Records — Aliases for Easier Management

Sometimes you want multiple domain names (like www.example.com, shop.example.com, etc.) to point to the same destination without repeating IPs.

  • A CNAME makes one hostname an alias of another (the canonical name).

  • DNS then follows that canonical name’s records (A/AAAA or others) to resolve it.

    For example, www.example.com can CNAME to example.com, inheriting whatever A/AAAA records example.com has.


MX Records — Where Email Should Go

DNS isn’t just about websites — it also handles email routing:

  • MX records say which mail server(s) should receive email for the domain (e.g., mail.example.com).

  • They include a priority number so senders know which server to try first.

    Email servers look up MX records when delivering mail, then usually follow those hostnames’ A/AAAA records to reach the actual server.


TXT Records — Extra Info & Verification

TXT records don’t direct traffic, but they provide additional textual data associated with the domain:

  • Used for verification (Google Search Console, other services).

  • Used for email security policies like SPF, DKIM, and DMARC (to prevent spoofing and spam).

    A mail server or external service checks these TXT strings to validate authenticity.

What DNS is (explained in very simple terms)

“DNS is phonebook of the internet” translating human readable domain names to machine readable IP address. It helps users to access website using memorable names instead of IP address. While we humans find it easy to remember names like google.com or chaicode.com, computers are much pickier—they communicate using numbers called IP addresses (like 192.168.1.1 or more complex strings).

Why DNS records are needed

Think of the internet like a massive, global city. While humans navigate by names (like "https://www.google.com/url?sa=E&source=gmail&q=google.com"), the infrastructure itself only understands coordinates (IP addresses like 142.250.190.46).

DNS (Domain Name System) records are the essential translation files that bridge this gap. Without them, you would have to memorize a string of numbers for every website you wanted to visit

What an NS Record is (who is responsible for a domain)

While the A record tells you where a house is, the NS (Name Server) Record tells you who holds the official map to the entire neighborhood.

In short, NS records specify which DNS servers are the "authoritative" source for your domain. They tell the rest of the internet: "If you want to find anything related to this domain (IPs, emails, etc.), go ask these specific servers."

An A Record (short for Address Record) is a fundamental part of the Domain Name System (DNS) that links a domain name to its IPv4 address — the numerical address computers use to find and communicate with each other over the internet.

What an A Record Does

  • It maps a human-friendly domain name (like example.com) to a machine-friendly IPv4 address (like 192.0.2.1).

  • When you type a domain into a browser, your device asks DNS servers for the A record to get the correct IP address and then connects to that server.

Why It Matters

  • Computers communicate using numbers (IP addresses), but humans prefer easy-to-remember names. The A record bridges that gap.

  • Without an A record, your domain wouldn’t know where to send web traffic, and the website wouldn’t load.

What an AAAA Record is (domain → IPv6 address)

An AAAA Record (pronounced “quad-A” record) is a specific type of DNS (Domain Name System) record that maps a domain name to an IPv6 address — the modern numerical address format used on the internet.

What an AAAA Record Does

  • It links a domain or hostname (like example.com or www.example.com) to a 128-bit IPv6 address (for example 2001:0db8:85a3::8a2e:0370:7334).

  • When a device looks up your domain, DNS can return this IPv6 address so the device knows where to connect over an IPv6 network.

Why It Matters

  • IPv6 is the successor to IPv4 and provides a vastly larger pool of IP addresses — important as the internet grows and IPv4 addresses become scarce.

  • AAAA records allow your domain to be reachable by clients that use IPv6 networking.

  • They work similarly to A records, but specifically for IPv6 instead of IPv4.

What a CNAME Record is (one name pointing to another name)

A CNAME Record (short for Canonical Name record) is a type of DNS (Domain Name System) record that lets one domain name act as an alias for another domain name instead of pointing directly to an IP address.

What a CNAME Record Does

  • A CNAME record maps one hostname (alias) to another hostname (the canonical or true name).

  • When someone looks up a domain with a CNAME, the DNS resolver follows that alias and continues the lookup using the target domain’s records (like its A or AAAA records), eventually returning an IP address.

  • In practice, this means the alias domain resolves to the same destination as the canonical name, without having to duplicate IP addresses in multiple places.

What an MX Record is (how emails find your mail server)

An MX Record (short for Mail exchange Record) is a type of DNS (Domain Name System) record that tells the internet where to deliver email for a domain — i.e., which mail server(s) handle incoming email for addresses at that domain.

What an MX Record Does

  • Routes email: When someone sends an email to you@yourdomain.com, the sending mail server looks up the MX records for yourdomain.com to find the correct mail server(s) that accept email for that domain.

  • Points to mail servers: An MX record doesn’t contain an IP address directly — it points to a hostname (like mail.yourdomain.com) that must have an A or AAAA record pointing to the actual IP.

What a TXT Record is (extra information and verification)

A TXT Record (short for Text Record) is a flexible type of DNS (Domain Name System) record that lets you attach arbitrary text information to a domain name — instead of pointing to an IP address like A/AAAA records do.

What a TXT Record Is

  • It is a DNS record that contains human-readable or machine-readable text associated with your domain.

  • There are no strict formatting rules for the text, though individual strings are typically limited to 255 characters (longer values can be split).

🧠 What It’s Used For

TXT records don’t direct traffic — instead, they provide extra information or instructions that outside services can read. Common uses include:

Domain & Service Verification

  • Many services (like search engine tools, hosting platforms, email providers) ask you to add a TXT record with a verification code to prove you control the domain.

Email Authentication & Security

TXT records are widely used to help email systems verify messages and prevent abuse:

  • SPF (Sender Policy Framework): Lists which mail servers are authorized to send email for your domain.

  • DKIM (DomainKeys Identified Mail): Stores a cryptographic public key that receiving servers use to verify that emails weren’t tampered with and really came from your domain.

  • DMARC (Domain-based Message Authentication, Reporting & Conformance): Defines policies for how receiving mail servers should handle messages that fail SPF/DKIM checks and can generate reports, and this policy is published via TXT record.

DNS Starts With Authority — NS & SOA Records

Before anything else, the DNS system needs to know which servers hold the records for your domain:

  • NS (Name Server) records tell the world which DNS servers are authoritative for your domain — the ones that actually hold its DNS records.

  • SOA (Start of Authority) holds administrative info like the primary server and versioning for updates.

    When you enter a domain (like example.com), the resolver first finds the NS records so it knows where to ask for details.


A / AAAA Records — Get the Website’s IP Address

Once the authoritative DNS server is found:

  • A records return an IPv4 address (e.g., 192.0.2.1).

  • AAAA records return an IPv6 address (e.g., 2001:db8::1).

    These are the core entries that let browsers locate your web server. Without these, the domain would not resolve to a server on the internet.


CNAME Records — Aliases for Easier Management

Sometimes you want multiple domain names (like www.example.com, shop.example.com, etc.) to point to the same destination without repeating IPs.

  • A CNAME makes one hostname an alias of another (the canonical name).

  • DNS then follows that canonical name’s records (A/AAAA or others) to resolve it.

    For example, www.example.com can CNAME to example.com, inheriting whatever A/AAAA records example.com has.


MX Records — Where Email Should Go

DNS isn’t just about websites — it also handles email routing:

  • MX records say which mail server(s) should receive email for the domain (e.g., mail.example.com).

  • They include a priority number so senders know which server to try first.

    Email servers look up MX records when delivering mail, then usually follow those hostnames’ A/AAAA records to reach the actual server.


TXT Records — Extra Info & Verification

TXT records don’t direct traffic, but they provide additional textual data associated with the domain:

  • Used for verification (Google Search Console, other services).

  • Used for email security policies like SPF, DKIM, and DMARC (to prevent spoofing and spam).

    A mail server or external service checks these TXT strings to validate authenticity.

More from this blog

Web Dev 2026

12 posts