# Fix DNS DMARC Authentication Fail
Your emails are failing DMARC authentication, or you're seeing errors like "DNS authentication DMARC fail" or "rua / ruf domains not valid" when setting up DMARC. DMARC (Domain-based Message Authentication, Reporting, and Conformance) is critical for email deliverability and preventing spoofing.
Introduction
This article covers troubleshooting steps and solutions for Fix DNS DMARC Authentication Fail. The error typically occurs in production environments and can cause service disruptions if not addressed promptly.
Symptoms
Common error messages include:
```bash # Query DMARC record dig TXT _dmarc.yourdomain.com +short
# Or using nslookup nslookup -type=TXT _dmarc.yourdomain.com
# Check with Google's DNS dig TXT _dmarc.yourdomain.com @8.8.8.8 +short ```
dig TXT yourdomain.com +short# Find DKIM selector (usually in email headers)
dig TXT default._domainkey.yourdomain.com +shortCommon Causes
- Configuration misconfiguration
- Missing or incorrect credentials
- Network connectivity issues
- Version compatibility problems
- Resource exhaustion or limits
- Permission or access denied
Understanding DMARC
DMARC tells email receivers how to handle messages that fail SPF or DKIM checks. It consists of a DNS TXT record at _dmarc.yourdomain.com.
Step-by-Step Fix
Check existing DMARC record:
```bash # Query DMARC record dig TXT _dmarc.yourdomain.com +short
# Or using nslookup nslookup -type=TXT _dmarc.yourdomain.com
# Check with Google's DNS dig TXT _dmarc.yourdomain.com @8.8.8.8 +short ```
Verify SPF record:
dig TXT yourdomain.com +shortVerify DKIM record:
# Find DKIM selector (usually in email headers)
dig TXT default._domainkey.yourdomain.com +shortTest DMARC with online tools:
```bash # Use MXToolbox curl -s "https://mxtoolbox.com/api/v1/dmarc/yourdomain.com"
# Or dmarcian curl -s "https://dmarcian.com/dmarc-inspector/yourdomain.com" ```
Common Errors and Solutions
Error 1: DMARC Record Not Found
# Error: No DMARC record found
dig TXT _dmarc.yourdomain.com
# (empty response)Solution: Create a DMARC TXT record:
```dns # Basic DMARC record (monitoring mode) _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com"
# Strict DMARC record (quarantine) _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=quarantine; pct=100; rua=mailto:dmarc@yourdomain.com"
# Strict DMARC record (reject) _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=reject; pct=100; rua=mailto:dmarc@yourdomain.com; ruf=mailto:dmarc-fail@yourdomain.com" ```
Error 2: rua/ruf Domains Not Valid
# Error: DNS DMARC rua / ruf domains not valid
# The reporting domain must be verifiedCause: External reporting domains require explicit authorization.
Solution: If using an external domain for reports, add a verification record:
# If rua points to external domain (e.g., dmarc-reports@reports.example.com)
# Add verification record at reports.example.com
yourdomain.com._report._dmarc.reports.example.com. IN TXT "v=DMARC1"For self-hosted reports:
# Use your own domain for reports
_dmarc.yourdomain.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com"Error 3: DMARC Fails Despite Valid SPF/DKIM
# SPF passes, DKIM passes, but DMARC failsCause: Alignment mismatch - the domain in the From header must match the domain used for SPF/DKIM.
Solution: Check alignment settings:
```dns # Strict alignment (exact match required) _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=reject; aspf=s; adkim=s"
# Relaxed alignment (subdomains allowed) _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=reject; aspf=r; adkim=r" ```
Verify alignment in email headers:
```bash # Check From header domain From: user@subdomain.yourdomain.com
# For strict alignment, SPF/DKIM must be for subdomain.yourdomain.com # For relaxed alignment, SPF/DKIM can be for yourdomain.com ```
Error 4: SPF Not Configured
DMARC requires SPF to pass:
# Add SPF TXT record at domain root
yourdomain.com. IN TXT "v=spf1 include:_spf.google.com include:sendgrid.net ~all"Verify SPF:
dig TXT yourdomain.com +short
# Should return SPF record starting with "v=spf1"Error 5: DKIM Not Configured
DMARC requires DKIM to pass:
```bash # Generate DKIM keys (example for Postfix) opendkim-genkey -D /etc/opendkim/keys/yourdomain.com -s default -d yourdomain.com
# The generated default.txt contains the DNS record cat /etc/opendkim/keys/yourdomain.com/default.txt ```
Add DKIM record to DNS:
default._domainkey.yourdomain.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC..."Error 6: Multiple DMARC Records
# Error: Multiple DMARC records found
dig TXT _dmarc.yourdomain.com +short
# Returns multiple recordsSolution: Remove duplicate records, keep only one:
```bash # Check for duplicates dig TXT _dmarc.yourdomain.com +short | wc -l
# Should return 1 ```
Error 7: Subdomain DMARC
For subdomains, create separate DMARC records:
```dns # Main domain _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com"
# Subdomain (optional, inherits from parent if not set) _dmarc.subdomain.yourdomain.com. IN TXT "v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com"
# Or use sp tag for subdomain policy _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=reject; sp=reject; rua=mailto:dmarc@yourdomain.com" ```
Error 8: DMARC Reports Not Received
# rua/ruf configured but no reports receivedSolution: Check report email configuration:
```bash # Verify rua email exists dig MX yourdomain.com +short
# Test email delivery echo "Test" | mail -s "DMARC Test" dmarc-reports@yourdomain.com
# Check mail logs tail -f /var/log/mail.log ```
Error 9: Percent Policy Too Low
# pct=1 means only 1% of failing emails are affected
_dmarc.yourdomain.com. IN TXT "v=DMARC1; p=reject; pct=1"Solution: Gradually increase pct as you verify everything works:
```dns # Start with monitoring _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=none; pct=100"
# After 1-2 weeks, quarantine 25% _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=quarantine; pct=25"
# After another week, quarantine 100% _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=quarantine; pct=100"
# Finally, reject 100% _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=reject; pct=100" ```
DMARC Record Components
| Tag | Description | Example |
|---|---|---|
| v | Protocol version | v=DMARC1 |
| p | Policy (none/quarantine/reject) | p=reject |
| sp | Subdomain policy | sp=reject |
| pct | Percentage affected | pct=100 |
| rua | Aggregate report URI | rua=mailto:dmarc@example.com |
| ruf | Failure report URI | ruf=mailto:dmarc-fail@example.com |
| aspf | SPF alignment (s/r) | aspf=r |
| adkim | DKIM alignment (s/r) | adkim=r |
| ri | Report interval (seconds) | ri=86400 |
| fo | Failure reporting options | fo=1 |
Verification
After configuring DMARC:
```bash # Verify DMARC record dig TXT _dmarc.yourdomain.com +short
# Check SPF dig TXT yourdomain.com +short
# Check DKIM dig TXT default._domainkey.yourdomain.com +short
# Test with online validator # https://dmarcian.com/dmarc-inspector/ # https://mxtoolbox.com/dmarc.aspx ```
Send test email and check headers:
# Look for Authentication-Results header
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of user@yourdomain.com designates 1.2.3.4 as permitted sender) smtp.mailfrom=user@yourdomain.com;
dkim=pass header.i=@yourdomain.com;
dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yourdomain.comComplete DMARC Setup Example
DNS Records
```dns # SPF yourdomain.com. IN TXT "v=spf1 ip4:1.2.3.4 include:_spf.google.com ~all"
# DKIM default._domainkey.yourdomain.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3..."
# DMARC (start with monitoring) _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:dmarc-reports@yourdomain.com; ruf=mailto:dmarc-fail@yourdomain.com; ri=86400; aspf=r; adkim=r" ```
Processing DMARC Reports
```bash # Install dmarc parser pip install parsedmarc
# Parse incoming reports parsedmarc --output /var/log/dmarc-reports/ /var/mail/dmarc/
# Or use dmarc-report-analyzer npm install -g dmarc-report-analyzer ```
Monitoring Dashboard
```bash # Use dmarcian or similar service # https://dmarcian.com/
# Or self-hosted with Grafana # https://github.com/domainaware/parsedmarc ```
Prevention
- 1.[ ] DMARC TXT record exists at
_dmarc.yourdomain.com - 2.[ ] SPF TXT record exists at
yourdomain.com - 3.[ ] DKIM TXT record exists at
selector._domainkey.yourdomain.com - 4.[ ] rua/ruf email addresses are valid and receiving
- 5.[ ] External rua/ruf domains have verification records
- 6.[ ] Only one DMARC record exists
- 7.[ ] Alignment settings match your email configuration
- 8.[ ] pct value is appropriate for your rollout stage
- 9.[ ] Test emails pass DMARC authentication
- 10.[ ] Reports are being received and processed
Related Articles
- [Technical troubleshooting: Fix Bounce Handling Verp Envelope Return Path Conf](bounce-handling-verp-envelope-return-path-configuration)
- [Fix Email Attachment Rejected Size Exceeding Provider Limit 25mb Issue in Email](email-attachment-rejected-size-exceeding-provider-limit-25mb)
- [Fix Email Bounce 550 Permanent Failure Recipient Address Rejected Issue in Email](email-bounce-550-permanent-failure-recipient-address-rejected)
- [Fix Email Dkim Signature Verification Failing After Key Rotation Issue in Email](email-dkim-signature-verification-failing-after-key-rotation)
- [Fix Email Dmarc Policy Quarantine Message In Spam Folder Issue in Email](email-dmarc-policy-quarantine-message-in-spam-folder)
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "TechArticle", "headline": "Fix DNS DMARC Authentication Fail", "description": "Step-by-step guide to fix DMARC authentication failures. Configure DNS records, resolve rua/ruf domain errors, and improve email deliverability.", "url": "https://www.fixwikihub.com/fix-dns-dmarc-authentication-fail", "publisher": { "@type": "Organization", "name": "FixWikiHub", "url": "https://www.fixwikihub.com" }, "author": { "@type": "Person", "name": "FixWikiHub Editorial Team" }, "datePublished": "2026-04-27T10:07:00.000Z", "dateModified": "2026-04-27T10:07:00.000Z" } </script>