Random Musings

Sporadic thoughts on tech, economics, business, finance and trading

All DNS Records Explained


Here is a comprehensive list of DNS record types, along with their purposes and examples:


1. A (Address) Record

  • Purpose: Maps a domain name to an IPv4 address.
  • Example:
  example.com.   IN   A   93.184.216.34
  • This record maps example.com to the IP address 93.184.216.34.

2. AAAA (IPv6 Address) Record

  • Purpose: Maps a domain name to an IPv6 address.
  • Example:
  example.com.   IN   AAAA   2606:2800:220:1:248:1893:25c8:1946
  • This record maps example.com to the IPv6 address 2606:2800:220:1:248:1893:25c8:1946.

3. MX (Mail Exchange) Record

  • Purpose: Specifies the mail server responsible for receiving emails for the domain.
  • Example:
  example.com.   IN   MX   10 mail.example.com.
  • This indicates that mail.example.com is the mail server for example.com, with a priority of 10 (lower numbers have higher priority).

4. PTR (Pointer) Record

  • Purpose: Used for reverse DNS lookups, mapping an IP address to a domain name.
  • Example:
  34.216.184.93.in-addr.arpa.   IN   PTR   example.com.
  • This maps the IP address 93.184.216.34 to the domain name example.com.

5. NS (Name Server) Record

  • Purpose: Specifies the authoritative name servers for the domain.
  • Example:
  example.com.   IN   NS   ns1.example.com.
  example.com.   IN   NS   ns2.example.com.
  • This indicates ns1.example.com and ns2.example.com are the authoritative name servers for example.com.

6. CNAME (Canonical Name) Record

  • Purpose: Creates an alias for a domain name.
  • Example:
  www.example.com.   IN   CNAME   example.com.
  • This means www.example.com is an alias for example.com.

7. TXT (Text) Record

  • Purpose: Stores arbitrary text, often used for verification or metadata (e.g., SPF, DKIM, or DMARC).
  • Example:
  example.com.   IN   TXT   "v=spf1 include:_spf.google.com ~all"
  • This is an SPF (Sender Policy Framework) record for email verification.

8. SRV (Service) Record

  • Purpose: Specifies information about services available for the domain.
  • Example:
  _sip._tcp.example.com.   IN   SRV   10 5 5060 sipserver.example.com.
  • This specifies a SIP service (_sip) running on sipserver.example.com over TCP, with priority 10, weight 5, and port 5060.

9. SOA (Start of Authority) Record

  • Purpose: Provides information about the domain, including the primary name server and admin email.
  • Example:
  example.com.   IN   SOA   ns1.example.com. admin.example.com. (
                        2024010101 ; Serial
                        3600       ; Refresh
                        1800       ; Retry
                        1209600    ; Expire
                        86400 )    ; Minimum TTL
  • This specifies the primary name server, ns1.example.com, admin email admin@example.com, and zone parameters.

10. DNSKEY Record

  • Purpose: Stores the public key for DNSSEC validation.
  • Example:
  example.com.   IN   DNSKEY   256 3 13 abcdefghijk...
  • This is part of DNSSEC, which adds security to DNS.

11. CAA (Certification Authority Authorization) Record

  • Purpose: Specifies which certificate authorities (CAs) are allowed to issue certificates for the domain.
  • Example:
    “`plaintext
    example.com. IN CAA 0 issue “letsen