Kling Digital
en
Contact
2025-05-21
7 MIN READ
Featured Guide

Implementing DMARC: Complete Guide to DNS TXT Records, Alignment, XML Reports & BIMI

Secure your organizational domain from email spoofing and Business Email Compromise (BEC) by deploying DMARC identifier alignment, phased enforcement policies, XML aggregate telemetry, and BIMI.

Implementing DMARC: Complete Guide to DNS TXT Records, Alignment, XML Reports & BIMI

What is the DMARC Protocol and Why SPF & DKIM Alone Cannot Prevent Spoofing

One of the most pervasive misconceptions in enterprise infrastructure security is assuming that publishing SPF (Sender Policy Framework) and DKIM (DomainKeys Identified Mail) records automatically protects a domain against exact-domain email spoofing. In reality, the SMTP specification defines two completely separate sender identities: the RFC 5321 Envelope Sender (MAIL FROM / Return-Path) used by mail servers for bounce routing, and the RFC 5322 Header Sender (From:) rendered inside the end user's email client (Gmail, Outlook, Apple Mail).

Without DMARC (Domain-based Message Authentication, Reporting, and Conformance — RFC 7489), an attacker can provision a throwaway domain (attacker-mailer.net), configure valid SPF and DKIM records for that throwaway domain, and transmit an email where the SMTP envelope specifies MAIL FROM:<bounce@attacker-mailer.net> while the visible message header reads From: "Chief Executive Officer" <ceo@yourdomain.com>. Because neither SPF nor DKIM checks the visible From: header against the authenticated domain, the message passes authentication and lands in the victim's inbox. DMARC eliminates this vulnerability by enforcing Identifier Alignment between the visible From: domain and the cryptographically verified SPF and DKIM domains.

1. DMARC Identifier Alignment Mechanics: aspf and adkim

Under DMARC evaluation, a raw SPF "Pass" or DKIM "Pass" is insufficient unless the authenticated domain aligns with the domain extracted from the RFC 5322 From: header. DMARC supports two alignment strictness modes for both SPF (aspf) and DKIM (adkim):

  • Relaxed Alignment (r — Default): The organizational root domain of the visible From: header must match the organizational root domain of the validated SPF (Return-Path) or DKIM (d=) attribute. For instance, if the header is From: billing@yourdomain.com and the envelope sender is Return-Path: bounce@ses.yourdomain.com, relaxed alignment succeeds.
  • Strict Alignment (s): The exact fully qualified domain name (FQDN) in the visible From: header must match the SPF or DKIM domain character-for-character. Under strict alignment (adkim=s; aspf=s), yourdomain.com and ses.yourdomain.com fail alignment.

2. Complete Reference of DMARC DNS TXT Record Tags

A DMARC policy is published as a standard DNS TXT record at the host label _dmarc.yourdomain.com. The table below details every specification tag and its architectural impact:

Tag Sample Value Requirement Technical Function & Architectural Impact
v v=DMARC1 Mandatory Declares the DMARC protocol version. Must appear as the very first tag in the TXT string or receivers will ignore the record.
p none | quarantine | reject Mandatory Enforcement policy for the organizational domain: none (monitor only), quarantine (route to spam), reject (block at SMTP).
sp sp=reject Optional Explicit policy applied to all subdomains. Prevents attackers from spoofing non-existent subdomains of your brand.
rua rua=mailto:dmarc-rua@yourdomain.com Recommended Comma-separated list of URIs where receiving MTAs dispatch daily compressed XML aggregate telemetry reports.
ruf ruf=mailto:dmarc-ruf@yourdomain.com Optional Destination URI for real-time forensic failure reports generated when individual messages fail authentication.
pct pct=100 Optional Percentage (1–100) of failing messages subjected to the enforcement policy, enabling safe incremental rollouts.
adkim r or s Optional DKIM identifier alignment mode: r (relaxed organizational match) or s (strict exact-hostname match).
aspf r or s Optional SPF identifier alignment mode: r (relaxed organizational match) or s (strict exact-hostname match).
fo 0 | 1 | d | s Optional Forensic failure reporting options. Setting fo=1 generates a report if either SPF or DKIM fails alignment.

3. How to Add DMARC Step-by-Step: 3-Phase Production Rollout

Deploying p=reject immediately on a legacy enterprise domain is dangerous: any unmapped third-party SaaS platform (ERP billing, HR applicant tracking, CRM marketing) lacking custom DKIM or Return-Path alignment will have its emails hard-bounced. At Kling Digital, we execute DMARC transitions across three deterministic engineering phases:

Phase 1: Telemetry Collection & Shadow IT Discovery (p=none)

Begin in non-intrusive observation mode. No messages are altered or blocked, but global mailbox providers begin delivering daily XML aggregate reports to your rua endpoint:

_dmarc.yourdomain.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc-rua@yourdomain.com; fo=1;"

Audit incoming XML reports for 14 to 30 days. Identify every legitimate sending service, configure 2048-bit DKIM selectors for each vendor, and establish custom bounce subdomains (CNAME/MX delegation) so SPF aligns under your organizational domain.

Phase 2: Controlled Quarantine & Percentage Throttling (p=quarantine)

Once 100% of authorized mail streams pass DMARC alignment, escalate the policy to p=quarantine so unauthenticated spoofing attempts are routed to recipients' spam folders. Start at pct=25 and scale to pct=100 after verifying zero false positives:

_dmarc.yourdomain.com. 3600 IN TXT "v=DMARC1; p=quarantine; pct=100; adkim=r; aspf=r; rua=mailto:dmarc-rua@yourdomain.com; fo=1;"

Phase 3: Full Zero-Trust Enforcement & Subdomain Lockdown (p=reject)

After confirming clean telemetry at full quarantine, lock down both the apex domain (p=reject) and all subdomains (sp=reject) so unauthorized messages are dropped during the SMTP transaction before reaching the recipient:

_dmarc.yourdomain.com. 3600 IN TXT "v=DMARC1; p=reject; sp=reject; pct=100; adkim=s; aspf=r; rua=mailto:dmarc-rua@yourdomain.com; ruf=mailto:dmarc-ruf@yourdomain.com; fo=1;"

Notice the hybrid alignment strategy: adkim=s enforces exact-domain DKIM signing while aspf=r accommodates cloud ESPs (such as Amazon SES or Postmark) that utilize a dedicated bounce subdomain like bounce.yourdomain.com.

4. Parsing and Auditing DMARC XML Aggregate Reports (RUA)

Mailbox providers dispatch daily .xml.gz archives to your rua address containing structured authentication tallies grouped by source IP. Below is a representative segment of a production DMARC XML report:

<record>
  <row>
    <source_ip>198.51.100.42</source_ip>
    <count>1420</count>
    <policy_evaluated>
      <disposition>none</disposition>
      <dkim>pass</dkim>
      <spf>pass</spf>
    </policy_evaluated>
  </row>
  <identifiers>
    <header_from>yourdomain.com</header_from>
  </identifiers>
  <auth_results>
    <dkim>
      <domain>yourdomain.com</domain>
      <selector>kling2026</selector>
      <result>pass</result>
    </dkim>
    <spf>
      <domain>notify.yourdomain.com</domain>
      <result>pass</result>
    </spf>
  </auth_results>
</record>

When auditing these reports, distinguish carefully between <auth_results> and <policy_evaluated>. A record may show <result>pass</result> inside <auth_results> (meaning raw SPF succeeded for a vendor's own bounce domain like sendgrid.net) while showing <spf>fail</spf> inside <policy_evaluated> because sendgrid.net does not align with yourdomain.com.

5. External Reporting Authorization (_report._dmarc)

If your organization manages multiple domains and routes all DMARC reports to a centralized security domain (e.g., sending reports for brand-alpha.com to dmarc@security-ops.com), RFC 7489 requires explicit DNS authorization to prevent denial-of-service report flooding. You must publish the following TXT record on the receiving domain's DNS zone:

brand-alpha.com._report._dmarc.security-ops.com. 3600 IN TXT "v=DMARC1"

Without this authorization pointer, Google and Microsoft silently strip external rua and ruf URIs.

6. BIMI (Brand Indicators for Message Identification) & VMC Integration

Achieving DMARC enforcement unlocks BIMI, an open specification that renders your cryptographically verified brand logo and verified checkmark directly beside your messages in Gmail, Apple Mail, and Yahoo inboxes.

To deploy BIMI in production, three technical prerequisites must be satisfied:

  1. Your domain's DMARC policy must be set to enforcement: either p=quarantine; pct=100 or p=reject (BIMI will not function under p=none).
  2. Your vector logo must conform strictly to the SVG Tiny Portable/Secure (SVG P/S) profile (no scripts, external links, or animations).
  3. To trigger the official verified checkmark in Gmail and Apple Mail, obtain a Verified Mark Certificate (VMC) or Common Mark Certificate (CMC) from an accredited Certificate Authority (DigiCert or Entrust) and host the PEM chain over HTTPS.
default._bimi.yourdomain.com. 3600 IN TXT "v=BIMI1; l=https://yourdomain.com/bimi/logo.svg; a=https://yourdomain.com/bimi/vmc.pem;"

7. Mitigating Indirect Mail Flows: Forwarding, Mailing Lists & ARC (RFC 8617)

When a domain enforces p=reject, indirect mail flows require special consideration. If an alumnus forwards mail from user@university.edu to a personal Gmail account without rewriting the envelope sender, the forwarding server's IP is not listed in your SPF record, causing SPF to fail. Similarly, discussion mailing lists that prepend [List-Name] to the Subject header or append footers invalidate the original DKIM body hash.

Because DMARC passes if either aligned SPF or aligned DKIM succeeds, signing every outbound message with 2048-bit DKIM ensures that standard auto-forwarded emails survive intact. For mailing lists that modify content, modern receivers rely on ARC (Authenticated Received Chain — RFC 8617) headers cryptographic seals applied by intermediate relays to preserve original authentication state prior to modification.

Frequently Asked Questions

Frequently asked questions regarding this guide.

Back to News
Share

Comments (0)

Share your thoughts and insights with the community.

No comments yet. Be the first to share your thoughts!

Leave a Comment

Your comment will be published after administrator approval.

Topical Authority & Internal Resource Hub

Related Architecture Benchmarks, Pillar Guides & Digital Tools

Rigorous benchmark matrices, in-depth B2B engineering guides, and interactive calculators to support your technical decision-making.

Technical Benchmark

Next.js vs WordPress Benchmark

Sub-second load times, zero plugin vulnerabilities, and TCO breakdown.

Read Full Benchmark Analysis
Architectural Benchmark

Framer vs Next.js Architectural Comparison

Visual design tools versus sovereign enterprise full-stack software.

Read Full Benchmark Analysis