Knowing DMARC Records and Setting Them Up Correctly
DMARC Records: Complete Guide
DMARC (Domain-based Message Authentication, Reporting, and Conformance) is an email authentication protocol that builds on SPF and DKIM to prevent email spoofing and phishing. This guide explains how DMARC works and how to configure it for your domain.
What is DMARC?
DMARC is a policy framework that tells receiving mail servers what to do with emails that fail SPF or DKIM authentication. It also provides reporting mechanisms so you can monitor email sent from your domain.
Why DMARC Matters
- Prevents email spoofing: Stops phishers from impersonating your domain
- Improves deliverability: Authenticated emails reach inboxes more reliably
- Provides visibility: Reports show who’s sending email from your domain
- Protects brand reputation: Prevents your domain from being used in scams
- Required by major providers: Gmail and Yahoo require DMARC for bulk senders
How DMARC Works
- Email sent: Someone sends an email from
user@yourdomain.com - SPF/DKIM check: Receiving server verifies SPF and DKIM
- Alignment check: DMARC verifies domain alignment
- Policy application: Server applies your DMARC policy (none/quarantine/reject)
- Reporting: Server sends DMARC report to you
DMARC Alignment
DMARC requires either SPF or DKIM to pass AND align with the From: domain.
Alignment types:
- Relaxed: Subdomains match (mail.example.com matches example.com)
- Strict: Exact domain match required
DMARC Record Format
DMARC records are TXT records added to _dmarc.yourdomain.com:
_dmarc.yourdomain.com TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com"
Required Tags
v=DMARC1
- DMARC version
- Must be first tag
- Always set to
DMARC1
p=policy
- Policy for domain emails
- Options:
none,quarantine,reject
Recommended Tags
rua=mailto:address
- Email address for aggregate reports
- Daily XML reports of DMARC results
- Can specify multiple addresses:
rua=mailto:dmarc1@example.com,mailto:dmarc2@example.com
ruf=mailto:address
- Email address for forensic reports
- Real-time failure reports
- Contains sample of failed messages
pct=percentage
- Percentage of emails to apply policy to
- Range: 0-100
- Default: 100
- Useful for gradual rollout:
pct=25(apply to 25% of emails)
sp=policy
- Policy for subdomains
- Options:
none,quarantine,reject - If omitted, uses main policy
Optional Tags
adkim=alignment
- DKIM alignment mode
- Options:
r(relaxed),s(strict) - Default:
r
aspf=alignment
- SPF alignment mode
- Options:
r(relaxed),s(strict) - Default:
r
ri=interval
- Report interval in seconds
- Default: 86400 (24 hours)
- Example:
ri=3600(hourly)
fo=options
- Forensic report options
0: Generate report if all fail (default)1: Generate report if any faild: Generate report if DKIM failss: Generate report if SPF fails
DMARC Policies
p=none (Monitor Mode)
What it does:
- No action taken on failed emails
- All emails delivered normally
- Reports sent for monitoring
Use when:
- First implementing DMARC
- Testing configuration
- Monitoring email sources
Example:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com
p=quarantine (Mark as Spam)
What it does:
- Failed emails marked as spam/junk
- Delivered to spam folder
- Not rejected outright
Use when:
- Confident in SPF/DKIM setup
- Want soft enforcement
- Transitioning to stricter policy
Example:
v=DMARC1; p=quarantine; pct=50; rua=mailto:dmarc-reports@yourdomain.com
p=reject (Block Delivery)
What it does:
- Failed emails completely rejected
- Never delivered to recipient
- Strongest protection
Use when:
- Fully confident in configuration
- All legitimate senders configured
- Maximum security needed
Example:
v=DMARC1; p=reject; rua=mailto:dmarc-reports@yourdomain.com; ruf=mailto:dmarc-forensics@yourdomain.com
Setting Up DMARC
Step 1: Prerequisites
Before implementing DMARC:
-
Set up SPF record
v=spf1 include:_spf.google.com ~all -
Configure DKIM
google._domainkey TXT "v=DKIM1; k=rsa; p=..." -
Test SPF and DKIM
- Send test emails
- Verify both pass authentication
Step 2: Create DMARC Record
Start with monitoring:
Host: _dmarc
Type: TXT
Value: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
TTL: 3600
Step 3: Add to DNS
Add the TXT record to your DNS provider:
Cloudflare example:
- Log in to Cloudflare
- Select your domain
- Go to DNS
- Click Add record
- Type:
TXT - Name:
_dmarc - Content:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com - Click Save
Other DNS providers:
- GoDaddy, Namecheap, Google Domains follow similar process
- Some providers require full subdomain:
_dmarc.yourdomain.com
Step 4: Wait for Propagation
DNS changes take time to propagate:
- Usually: 15 minutes to 1 hour
- Maximum: Up to 48 hours
Step 5: Verify DMARC Record
Command line:
nslookup -type=TXT _dmarc.yourdomain.com
Online tools:
DMARC Gradual Rollout
Don’t jump straight to p=reject. Follow this recommended progression:
Phase 1: Monitor (2-4 weeks)
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
Goals:
- Collect aggregate reports
- Identify all email sources
- Find authentication issues
- Verify SPF/DKIM configuration
Phase 2: Quarantine Partial (2-4 weeks)
v=DMARC1; p=quarantine; pct=25; rua=mailto:dmarc@yourdomain.com
Goals:
- Apply quarantine to 25% of emails
- Monitor impact on delivery
- Gradually increase pct: 25 → 50 → 75 → 100
Phase 3: Quarantine Full (2-4 weeks)
v=DMARC1; p=quarantine; pct=100; rua=mailto:dmarc@yourdomain.com
Goals:
- Apply quarantine to all emails
- Monitor for false positives
- Verify no legitimate email affected
Phase 4: Reject (Production)
v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com; ruf=mailto:dmarc-forensics@yourdomain.com
Goals:
- Maximum protection
- Block all unauthenticated email
- Ongoing monitoring via reports
DMARC Reports
Aggregate Reports (RUA)
Format: XML files sent daily (or per ri setting)
Contains:
- IP addresses sending from your domain
- Number of emails passed/failed
- SPF and DKIM results
- Receiving organizations
Example report summary:
Source IP: 142.250.185.27
Messages: 1,250
SPF Pass: 1,248
DKIM Pass: 1,250
DMARC Pass: 1,248
Forensic Reports (RUF)
Format: Individual email samples
Contains:
- Full email headers
- Subject and timestamp
- Authentication failure details
Note: Many providers don’t send forensic reports due to privacy concerns.
Analyzing Reports
Manual analysis:
- Reports are XML files
- Can be complex to parse
- Time-consuming for high-volume domains
DMARC analysis services:
- Postmark (free for low volume)
- DMARC Analyzer
- Dmarcian
- Valimail
- EasyDMARC
These services:
- Parse XML reports automatically
- Provide dashboards and visualizations
- Alert on issues
- Recommend configuration changes
Complete DMARC Examples
Basic DMARC (Monitoring)
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
Intermediate DMARC
v=DMARC1; p=quarantine; pct=100; rua=mailto:dmarc@yourdomain.com; ruf=mailto:dmarc-forensics@yourdomain.com; fo=1
Advanced DMARC (Strict)
v=DMARC1; p=reject; sp=reject; rua=mailto:dmarc@yourdomain.com; ruf=mailto:dmarc-forensics@yourdomain.com; adkim=s; aspf=s; pct=100; fo=1
DMARC with External Service
v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com,mailto:randomstring@dmarc-service.com
Subdomain Policies
DMARC can have different policies for subdomains:
Same Policy for Subdomains
v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com
All subdomains inherit p=reject.
Different Subdomain Policy
v=DMARC1; p=quarantine; sp=reject; rua=mailto:dmarc@yourdomain.com
- Main domain: quarantine
- Subdomains: reject
Specific Subdomain DMARC
Create separate record for subdomain:
Host: _dmarc.mail.yourdomain.com
Value: v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com
Testing DMARC
Send Test Emails
-
From legitimate source:
- Should pass DMARC
- Check email headers for
dmarc=pass
-
From unauthorized source:
- Should fail based on policy
- Monitor what happens (deliver/quarantine/reject)
Check Email Headers
Gmail:
- Open email
- Click three dots > Show original
- Look for DMARC result:
dmarc=pass action=none header.from=yourdomain.com
Online Testing Tools
- Mail Tester: mail-tester.com
- DMARC Analyzer: Test email and get instant DMARC analysis
- MXToolbox: Comprehensive email authentication testing
Common Issues
DMARC Not Working
Causes:
- SPF or DKIM not configured
- DNS propagation delay
- Syntax errors in DMARC record
- Alignment failures
Solutions:
- Verify SPF and DKIM are passing
- Wait 24-48 hours for DNS propagation
- Use DMARC validator to check syntax
- Check alignment settings (relaxed vs strict)
Not Receiving Reports
Causes:
- Email address in
ruadoesn’t exist - Reports blocked by spam filter
- DNS record not propagated
- No email sent from domain yet
Solutions:
- Verify email address is valid and monitored
- Check spam folder
- Whitelist report sender addresses
- Wait at least 24 hours for first reports
Legitimate Email Failing
Causes:
- Forwarding breaks SPF
- Third-party senders not configured
- Mailing lists modify headers
- Alignment issues
Solutions:
- Add third-party IPs to SPF
- Configure DKIM for all senders
- Use
p=quarantineinstead ofp=rejecttemporarily - Review DMARC reports to identify sources
Best Practices
- Start with p=none: Always begin in monitor mode
- Configure SPF and DKIM first: DMARC requires these
- Use reporting addresses: Monitor with
ruaandruf - Gradual rollout: Use
pctto slowly increase policy coverage - Analyze reports regularly: Review at least weekly initially
- Document email sources: Know all services sending from your domain
- Set subdomain policy: Use
sp=to protect subdomains - Consider strict alignment: Use
adkim=sandaspf=sfor maximum security - Test thoroughly: Send test emails before enforcing strict policies
- Monitor ongoing: Even after full deployment, review reports monthly
DMARC and Email Forwarding
Email forwarding can break DMARC:
The problem:
- Forwarded emails appear to come from original domain
- But sent from forwarding server’s IP
- Fails SPF alignment
Solutions:
-
ARC (Authenticated Received Chain):
- Preserves authentication across forwards
- Supported by major email providers
-
SRS (Sender Rewriting Scheme):
- Rewrites From: address during forwarding
- Maintains authentication chain
-
Relaxed alignment:
- Use
aspf=rinstead ofaspf=s - Allows subdomain alignment
- Use
Conclusion
DMARC is the final pillar of email authentication, working with SPF and DKIM to protect your domain from spoofing and phishing. A properly configured DMARC policy:
- Prevents unauthorized use of your domain
- Improves email deliverability
- Provides visibility into email sending
- Protects your brand reputation
Start with p=none, analyze reports, fix issues, then gradually move to p=quarantine and eventually p=reject for maximum protection.
Quick Reference
Basic DMARC Record:
_dmarc TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com"
DMARC Policies:
p=none: Monitor onlyp=quarantine: Mark as spamp=reject: Block delivery
Recommended Progression:
Phase 1: p=none
Phase 2: p=quarantine; pct=25
Phase 3: p=quarantine; pct=100
Phase 4: p=reject
Check DMARC:
nslookup -type=TXT _dmarc.yourdomain.com