Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Updated
•4 min read•View as Markdown

DNS records are like instructions that tell the internet how to handle your domain name (for website, email, verification, etc.). They map your human‑friendly name (like example.com) to technical details (like IP address or mail server)

What is DNS and a DNS record?

  • DNS (Domain Name System) is the phonebook of the internet: it converts names like google.com into IP addresses like 142.250.190.78 so browsers know where to connect.

  • A DNS record is a single entry inside DNS that stores some information about your domain, such as its IP address, email server, or verification data.

Example: When you type example.com, your browser asks DNS for the A record of example.com, gets an IP address back, and then connects to that server.

Most common DNS record types

1. A record (Address)

  • Purpose: Connects a domain name to an IPv4 address (e.g., 93.184.216.34).

  • Use: Basic website hosting; almost every website uses A records.

Example:
example.com -> 93.184.216.34 (A record) means opening example.com will send users to that server.


2. AAAA record (IPv6 address)

  • Purpose: Connects a domain name to an IPv6 address (e.g., 2001:db8::1).

  • Use: Same as A record but for IPv6, which is the newer, larger address system.

Example:
example.com -> 2001:db8::1 (AAAA record) for users and networks using IPv6.


3. CNAME record (Alias)

  • Purpose: Makes one domain name an alias of another domain name.

  • Use: Point many subdomains to a single target, or point your domain to a service provider’s domain.

Rules (simple view):

Example:
www.example.com -> example.com (CNAME), so both go to the same place.


4. MX record (Mail Exchange)

  • Purpose: Tells which mail servers handle email for your domain.

  • Use: Needed for sending/receiving email like user@example.com.

Key points:

  • MX records point to hostnames (like mail.example.com), not IPs.

  • They have priority numbers: smaller number = more preferred server.

Example:
example.com -> 10 mail1.example.com and 20 mail2.example.com (backup).


5. TXT record (Text)

  • Purpose: Store text data related to your domain.

  • Use: Common for verification and security, not for users to see directly.

Typical uses:

  • SPF (which servers can send email for your domain).

  • DKIM (email signature for anti‑spoofing).

  • Domain ownership checks (Google, AWS, etc.).

Example:
example.com -> "v=spf1 include:_spf.google.com ~all" (SPF in TXT).


6. NS record (Name Server)

  • Purpose: Tells which DNS servers are authoritative for your domain (where the real records live).

  • Use: Connects your domain registrar to your DNS hosting provider (like Cloudflare, Route53, etc.).

Example:
example.com -> ns1.dnsprovider.com, ns2.dnsprovider.com.


7. SOA record (Start of Authority)

  • Purpose: Stores important info about the DNS zone, such as main DNS server, admin email, and timing values.

  • Use: Required for every DNS zone; used by DNS servers, not by end users.

Contains fields like: primary name server, admin email, serial number (for changes), refresh and retry times.


8. PTR record (Pointer, reverse DNS)

  • Purpose: Maps an IP address back to a domain name (reverse of A/AAAA).

  • Use: Often checked by mail providers to trust emails from your server.

Example:
93.184.216.34 -> example.com (PTR) says “this IP belongs to example.com”.


9. SRV record (Service)

  • Purpose: Specifies the server and port for a service (like VoIP, chat, etc.).

  • Use: Used by some apps to discover where to connect (for example, SIP, XMPP, some Microsoft services).

Includes: service name, protocol (TCP/UDP), priority, weight, port, and target hostname.

Other useful but less common records

  • ANAME / ALIAS: Like CNAME but allowed at root (example.com), used by some DNS providers to point the root to another hostname.

  • CAA: Says which certificate authorities can issue SSL certificates for your domain (extra security).

  • CERT: Stores public key certificates and related data in DNS, used in some advanced setups.

  • LOC: Stores physical location (latitude/longitude) of a host; rarely used.

  • HINFO / RP: Old/rare records for host info or responsible person contact details.