Skip to content
Shop

CommunityJoin Our PatreonDonate

Sponsored Ads

Sponsored Ads

DNS

A good DNS record schema on a name server typically involves several types of records that help translate domain names into IP addresses and provide other crucial services for your domain. Here’s a general schema:

1. A Record (Address Record)

  • Purpose: Maps a domain name to an IPv4 address.
  • Example:
    • example.com IN A 192.0.2.1
  • TTL: Typically 300 to 86400 seconds.

2. AAAA Record

  • Purpose: Maps a domain name to an IPv6 address.
  • Example:
    • example.com IN AAAA 2001:0db8:85a3:0000:0000:8a2e:0370:7334
  • TTL: Typically 300 to 86400 seconds.

3. CNAME Record (Canonical Name Record)

  • Purpose: Alias of one name to another. Useful for pointing multiple domain names to the same IP address.
  • Example:
    • www.example.com IN CNAME example.com
  • TTL: Typically 300 to 86400 seconds.

4. MX Record (Mail Exchange Record)

  • Purpose: Specifies the mail servers responsible for receiving email on behalf of your domain.
  • Example:
    • example.com IN MX 10 mail.example.com
  • Priority: Lower numbers have higher priority.
  • TTL: Typically 3600 to 86400 seconds.

5. TXT Record

  • Purpose: Used to store text information. Commonly used for SPF (Sender Policy Framework), DKIM (DomainKeys Identified Mail), and other verification records.
  • Example:
    • example.com IN TXT "v=spf1 include:_spf.google.com ~all"
  • TTL: Typically 300 to 86400 seconds.

6. NS Record (Name Server Record)

  • Purpose: Specifies the authoritative name servers for the domain.
  • Example:
    • example.com IN NS ns1.nameserver.com
  • TTL: Typically 86400 seconds.

7. SOA Record (Start of Authority Record)

  • Purpose: Provides information about the DNS zone, including the primary name server, the email of the domain administrator, and the domain’s serial number.
  • Example:
    • example.com IN SOA ns1.nameserver.com. admin.example.com. (
          2023082301 ; Serial number
          7200       ; Refresh
          3600       ; Retry
          1209600    ; Expire
          86400      ; TTL
      )
  • TTL: Typically 86400 seconds.

8. SRV Record (Service Record)

  • Purpose: Specifies the location of servers for specific services, such as VoIP or instant messaging.
  • Example:
    • _sip._tcp.example.com. 86400 IN SRV 10 5 5060 sipserver.example.com.
  • TTL: Typically 300 to 86400 seconds.

9. PTR Record (Pointer Record)

  • Purpose: Maps an IP address to a domain name (reverse DNS lookup).
  • Example:
    • 1.2.0.192.in-addr.arpa. IN PTR example.com
  • TTL: Typically 86400 seconds.

10. CAA Record (Certification Authority Authorization)

  • Purpose: Specifies which certificate authorities (CAs) are allowed to issue certificates for your domain.
  • Example:
    • example.com. IN CAA 0 issue "letsencrypt.org"
  • TTL: Typically 86400 seconds.

TTL (Time to Live)

  • Each record type has a TTL value, which determines how long the record is cached by DNS resolvers.

Example DNS Zone File

plaintext
$TTL 86400
@   IN  SOA ns1.nameserver.com. admin.example.com. (
        2023082301 ; Serial
        7200       ; Refresh
        3600       ; Retry
        1209600    ; Expire
        86400      ; Minimum TTL
    )

    IN  NS  ns1.nameserver.com.
    IN  NS  ns2.nameserver.com.

    IN  A   192.0.2.1
    IN  AAAA 2001:0db8:85a3:0000:0000:8a2e:0370:7334

www IN  CNAME   example.com.
mail IN  MX 10  mail.example.com.

@   IN  TXT "v=spf1 include:_spf.google.com ~all"

This schema covers the most common DNS records. Depending on your needs, you might include additional records or make adjustments to the TTL values or priorities.

Resources

DNS Records Explained ⭐ ⭐ ⭐ ⭐ ⭐

DNS in 100 Seconds

DNS System Design

DNS Explained