[DNS Fundamentals Part 6] Resource Records, Part 2: MX, SPF, DKIM, DMARC, SRV, PTR, CAA, and HTTPS Records

DNS Fundamentals Part 6 Resource Records, Part 2: MX, SPF, DKIM, DMARC, SRV, PTR, CAA, and HTTPS Records DNS

“Notification emails stopped arriving, but only for Gmail recipients.”
“Automatic certificate renewal suddenly started failing.”

Trace the cause of requests like these, which have become more common lately, and you often end up at DNS records. Email and certificates are now inseparable from DNS configuration.

Part 5 (the first half) covered the records that form the skeleton of a zone: SOA, NS, A/AAAA, and CNAME. In this second half we cover mail delivery and authentication (MX, SPF, DKIM, DMARC), SRV, which Active Directory relies on, PTR for reverse lookups, CAA for certificates, and the relatively new HTTPS/SVCB records.

▶ This part is also available as a YouTube video (about 19 min) (it is also embedded at the end of this article).


MX and Null MX

An MX (Mail eXchange) record is the delivery destination for email addressed to a domain. A sending mail server looks up the MX records for the recipient’s domain and connects to them.

example.com.         3600 IN MX 10 mail1.example.com.
example.com.         3600 IN MX 20 mail2.example.com.
; Explicitly state that this domain does not receive mail (Null MX)
noreply.example.com. 3600 IN MX 0 .
  • The lower the preference value, the higher the priority. How mail is spread across records with the same value depends on the sender’s implementation
  • The value must be a hostname that resolves through A/AAAA. Do not put an IP address or a name that is a CNAME (Part 5)
  • MX records can also be set individually on subdomains (sub.example.com)

An easily overlooked point is what happens when there is no MX record. The sender then treats the name’s A/AAAA record as the delivery destination and tries to send mail there (RFC 5321). Even a domain that has only a web server will receive connection attempts from mail senders.

For a domain that does not receive mail, state it explicitly with a Null MX (MX 0 ., RFC 7505). This prevents wasted and misdirected delivery attempts.


TXT and SPF

A TXT record holds an arbitrary string. A single string can be up to 255 bytes, but you can store more by splitting the value into multiple strings (for example, a long DKIM public key).

There are two main uses:

  • Authenticating the domain that sends mail (SPF, DKIM, DMARC)
  • Verifying domain ownership (Microsoft 365, Google, various SaaS products, and certificate issuance ask you to “register this string as a TXT record”)
example.com. 3600 IN TXT "v=spf1 ip4:192.0.2.25 include:_spf.example.net -all"
example.com. 3600 IN TXT "MS=ms12345678"

SPF (RFC 7208) declares which servers are allowed to send mail for the domain.

  • -all: anything not listed fails
  • ~all: anything not listed is suspicious (softfail)

SPF has constraints that are easy to trip over.

  • There can be only one SPF record per name. If you write two, both may be treated as invalid
  • There is a limit of 10 DNS lookups triggered by include and similar mechanisms. It is easy to exceed if you keep adding SaaS products
  • The SPF-specific record type (type 99) has been deprecated. Write SPF in TXT

“Every time we added a mail delivery service we added another include, and before we knew it we were over 10” is a truly common story.


DKIM and DMARC

Alongside SPF, sender-domain authentication for email uses DKIM and DMARC. Let’s sort out how the three relate.

Diagram showing that a receiving server, on getting mail from a sending server, checks SPF (TXT at example.com), DKIM (TXT at selector._domainkey), DMARC (TXT at _dmarc), and the reverse lookup (PTR) in DNS
MechanismWhere the record livesWhat it containsStandard
SPFTXT at the domain name (example.com)Servers allowed to sendRFC 7208
DKIMTXT at selector._domainkey.example.com (sometimes a CNAME pointing to the provider)Public key for verifying signaturesRFC 6376
DMARCTXT at _dmarc.example.comChecks that the SPF and DKIM results align with the From domain, and states what to do on failure and where to send reportsRFC 7489 → RFC 9989 (May 2026)
s1._domainkey.example.com. 3600 IN TXT ( "v=DKIM1; k=rsa; "
    "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..." )
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc-rua@example.com"

(The DKIM public key is abbreviated.)

The trick with DMARC is not to be strict right away. Start with p=none (monitoring only), collect reports, confirm that your legitimate mail passes, and then tighten step by step to quarantine and then reject. If you jump straight to reject, every sender you did not know about (for example, notification mail from an old system) gets blocked.

Note that DMARC was revised in May 2026 as RFC 9989. In Microsoft 365, DKIM is pointed to Microsoft with CNAME records such as selector1._domainkey.


Sender guidelines and DNS

Behind the “only Gmail recipients are affected” problem at the start is the sender guidelines of the large mail providers.

ReceiverStartedAll sendersBulk senders (5,000+ messages per day)
GmailFebruary 2024SPF or DKIM, forward and reverse lookups set up, TLS, spam rate below 0.3%Both SPF and DKIM, DMARC (p=none is acceptable), alignment with the From domain, one-click unsubscribe
YahooFebruary 2024SPF or DKIM, forward and reverse lookups set up, spam rate below 0.3%Both SPF and DKIM, DMARC (p=none or stricter), alignment with the From domain, one-click unsubscribe
Microsoft (consumer services such as Outlook.com and Hotmail)May 5, 2025(Recommendations only)SPF and DKIM pass, DMARC (p=none or stricter) aligned with From. Non-compliant mail is rejected with 550 5.7.515

What matters to whoever manages DNS is the TXT records for SPF, DKIM, and DMARC, and a matching forward and reverse lookup (PTR) for the sending server’s IP address. Since November 2025, Gmail has been stepping up temporary and permanent rejection of mail that does not meet the requirements.

Notification mail from internal systems can be affected too. Scan-to-email from multifunction printers, alerts from monitoring systems, notifications from business applications: identify every sender and include them in SPF and DKIM.


SRV: Showing where a service is

An SRV (RFC 2782) record says “this service is on which port of which server.” The name takes the form _service._protocol.domain.

; _service._protocol.name               TTL      SRV priority weight port target
_ldap._tcp.corp.example.com.            600 IN SRV 0 100 389 dc01.corp.example.com.
_kerberos._tcp.corp.example.com.        600 IN SRV 0 100 88  dc01.corp.example.com.
_ldap._tcp.dc._msdcs.corp.example.com.  600 IN SRV 0 100 389 dc01.corp.example.com.
  • The lower the priority value, the higher the priority. Among records with the same priority, traffic is spread by the ratio of the weights
  • Do not put a CNAME name in the target

The biggest user of SRV is Active Directory.

Diagram showing a domain-joined PC asking the internal DNS for the SRV record _ldap._tcp.dc._msdcs, looking up the address of the dc01 that comes back, and connecting to the DC over LDAP and Kerberos

Clients find domain controllers by looking up SRV records. That is why, when “a PC can’t join the domain” or “sign-in is slow,” you first suspect missing SRV records (Part 10).

$ dig _ldap._tcp.dc._msdcs.corp.example.com SRV +short
0 100 389 dc01.corp.example.com.

PS> Resolve-DnsName _ldap._tcp.dc._msdcs.corp.example.com -Type SRV

PTR and reverse lookup zones

A PTR record is the record for a reverse lookup, finding a name from an IP address. It lives under in-addr.arpa for IPv4 and ip6.arpa for IPv6 (RFC 3596), at a name made by writing the address in reverse order.

Diagram showing the octets of the IPv4 address 192.0.2.10 reversed to make 10.2.0.192.in-addr.arpa., where the PTR record is placed
; IPv4: 192.0.2.10 → 10.2.0.192.in-addr.arpa.
$ORIGIN 2.0.192.in-addr.arpa.
10      IN PTR  www.example.com.

; IPv6: 2001:db8::10 → the 32 hex digits, reversed one digit (nibble) at a time
0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. IN PTR www.example.com.

Why reversed? Because in a DNS name the larger unit is on the right (Part 2). In an IP address the larger unit is on the left, so reversing it lets the address sit directly in the DNS tree.

$ dig -x 192.0.2.10 +short
www.example.com.

PS> Resolve-DnsName 192.0.2.10        # Passing an IP address looks up the PTR

Three points to keep in mind about reverse lookups:

  • A reverse zone is delegated to you not by your domain registrar but by whoever allocated the IP addresses (your ISP, or a registry such as APNIC or, in Japan, JPNIC). For allocations smaller than a /24, delegation may be done with classless delegation using CNAMEs (RFC 2317)
  • Without a reverse record, servers that look up the connecting client’s name (such as SSH) suffer delays while waiting for a timeout
  • Mail sending servers and vSphere require the forward and reverse lookups to match (Part 10)

CAA: Which CAs may issue certificates

A CAA (RFC 8659) record declares which certificate authorities (CAs) may issue certificates for the domain.

example.com. 3600 IN CAA 0 issue "letsencrypt.org"
example.com. 3600 IN CAA 0 issue "amazon.com"
example.com. 3600 IN CAA 0 issuewild ";"
example.com. 3600 IN CAA 0 iodef "mailto:security@example.com"

The example above allows only Let’s Encrypt and Amazon (ACM) and prohibits wildcard certificates.

Diagram showing a CA that receives a certificate request finding no CAA at www.example.com, so checking example.com further up; a listed CA may issue and an unlisted CA is refused
  • Since September 8, 2017, CAs are required to check CAA before issuing (CA/Browser Forum Ballot 187). If CAA exists, CAs that are not listed refuse to issue
  • A name with no CAA is checked by climbing to its parent name (www.example.com → example.com). If there is none anywhere, any CA may issue
  • iodef is where violations are reported. accounturi (RFC 8657) can limit issuance even to a specific CA account, and issuemail (RFC 9495) is for S/MIME certificates

The “automatic certificate renewal suddenly fails” at the start is sometimes caused by exactly this. If you forget to add CAA when you change CAs or start using a new CA such as ACM, issuance and automatic renewal fail.


HTTPS/SVCB records

Finally, a relatively new record type. The SVCB and HTTPS records (RFC 9460, November 2023) tell clients “how to connect” via DNS before they connect.

Diagram showing a browser asking for an HTTPS record together with A/AAAA, receiving alpn="h3,h2" and the ECH key, and connecting with HTTP/3 and ECH from the start; and showing that without an HTTPS record it connects over HTTP/2, receives Alt-Svc, and uses HTTP/3 from the next time

The HTTPS record is the form for the web, and it can carry information such as:

  • Supported protocols (alpn="h3,h2" means HTTP/3 is supported too)
  • Candidate IP addresses (ipv4hint and ipv6hint)
  • The key for TLS ECH (a mechanism that encrypts the name of the server you are connecting to, RFC 9849, March 2026)

A browser can choose HTTP/3 from the start or hide the name with ECH. Without an HTTPS record, it first connects over HTTP/2, receives the Alt-Svc header, and uses HTTP/3 from the next time, so the benefit is that you learn how to connect before you connect.

Also, with priority-0 AliasMode, you can point the zone apex to another name using a standard mechanism (Part 5).

Syntax and support

; ServiceMode: say that HTTP/3 and HTTP/2 are supported
example.com.     3600 IN HTTPS 1 . alpn="h3,h2" ipv4hint=192.0.2.10 ipv6hint=2001:db8::10
; AliasMode: point the apex to a CDN name (priority 0)
example.org.     3600 IN HTTPS 0 cdn.example.net.
$ dig example.com HTTPS +short
1 . alpn="h3,h2" ipv4hint=192.0.2.10 ipv6hint=2001:db8::10

The value . means “this name itself.”

ClientUse of HTTPS records (as of September 2026)
Safari (iOS 14 / macOS 11 and later)The OS API queries for it when connecting
Chrome (117 and later)Fetched through its built-in resolver or DoH and used for ECH (enabled by default)
FirefoxFetched when DoH is in use. From 129, also fetched through the OS resolver (except on macOS)

Clients that do not support it ignore it, so adding one does not break existing connections. Some CDNs publish it automatically.

Two cautions. Windows’ built-in Resolve-DnsName cannot specify the HTTPS type, so use dig on Linux or similar to check. Also, ipv4hint and the like are only hints and cannot replace A/AAAA records. When you change A/AAAA, update the hints to match.


Other records

Let’s at least know the names of the records not covered so far.

TypePurposeNotesStandard
TLSAShows the hash of a server certificate (public key) in DNS (DANE)Placed at a name such as _25._tcp.mail.example.com. Used for TLS between mail servers. Requires DNSSECRFC 6698
SSHFPFingerprint of an SSH host keyChecked by OpenSSH’s VerifyHostKeyDNS. Requires DNSSECRFC 4255
NAPTRRules for rewriting stringsUsed for ENUM (phone number → URI) and SIPRFC 3403
DS / DNSKEY / RRSIG / NSEC, NSEC3DNSSEC keys, signatures, and proof of nonexistenceCovered in Part 9RFC 4034 and others
HINFOHost informationUsed as a minimal response to ANY queriesRFC 8482
SPF (type 99)SPF onlyDeprecated. Write SPF in TXTRFC 7208

IANA’s list defines about 90 DNS types, but the ones covered in Parts 5 and 6 account for most of what you use in daily operations. When you run into an unfamiliar type, check its number and standard in IANA’s “Resource Record (RR) TYPEs.”


Think about it

  1. Check the SPF, DKIM, DMARC, and CAA records of your own domain with dig. Are all the senders of your systems’ notification mail included in SPF?
  2. For domains that neither send nor receive mail (such as web-only domains), are Null MX and SPF -all set?
  3. Do the IP addresses of your internal servers and mail sending servers have correct reverse lookups (PTR)?

Hint: Three commands, dig example.com TXT, dig _dmarc.example.com TXT, and dig example.com CAA, show most of the settings related to mail and certificates. In PowerShell, use Resolve-DnsName _dmarc.example.com -Type TXT (CAA cannot be specified, so check it with dig).


Summary

  • With no MX, senders try to deliver to the A record. Mark domains that do not receive mail with a Null MX
  • SPF is one record per name, and 10 DNS lookups at most
  • Tighten DMARC gradually, after monitoring with p=none
  • With the Gmail, Yahoo, and Microsoft sender guidelines, SPF, DKIM, DMARC, and reverse lookups are effectively mandatory
  • AD finds DCs through SRV. A reverse zone is delegated by whoever allocated the addresses
  • Remember CAA when you change CAs. HTTPS records do not break anything when you add them

Next time, we look at how to operate the authoritative DNS servers that hold these records.


Watch the video

This part is also explained in a YouTube video (about 19 min).

All parts of the series are in the DNS Fundamentals playlist on YouTube.

The DNS Fundamentals series (12 parts)

All 12 parts with a reading guide: DNS Fundamentals

  1. What Is DNS? How Name Resolution Works and Its Three Key Players
  2. The domain name hierarchy and delegation
  3. How name resolution works
  4. DNS messages and transport
  5. Resource records, part 1
  6. Resource records, part 2 (this article)
  7. Running authoritative DNS servers
  8. Investigating with commands
  9. DNS security
  10. DNS in the cloud and on corporate networks
  11. DNS troubleshooting
  12. DNS design exercises

This series is the English edition of 【DNS入門】, originally written in Japanese.

コメント

Copied title and URL