Missing or incorrect DMARC policies leave your domain vulnerable to spoofing. Studies show that 60% of domains lack DMARC that cause legitimate emails to be marked as spam or rejected entirely. Without proper SPF configuration, your emails lack authentication, making them vulnerable to being flagged by spam filters.
Our DMARC Checker solves this problem by validating your domain's Domain-based Message Authentication records, checking syntax for errors, analyzing DNS lookup chains to prevent the "too many DNS lookups" error, and providing actionable recommendations to fix configuration issues before they impact email delivery.
Whether you're an email marketer ensuring campaign deliverability, a system administrator managing domain configuration, or a developer troubleshooting authentication failures, this tool identifies SPF problems in seconds and guides you to the correct configuration.
What is the DMARC Checker?
The DMARC Checker is an email authentication validation tool that analyzes your domain's DMARC (Domain-based Message Authentication) records - the DNS TXT records that define how receiving servers should handle authentication failures on behalf of your domain. When email servers receive mail from your domain, they check the DMARC policy to verify the sender is legitimate.
How it works: The script queries your domain's DNS TXT records, extracts the SPF policy string (starting with "v=spf1"), parses all mechanisms (ip4, ip6, a, mx, include, etc.), validates syntax according to RFC 7208 standards, counts DNS lookups to ensure you stay under the 10-lookup limit, and identifies common errors like missing records, syntax mistakes, or circular references.
What makes this tool essential is its ability to detect the "too many DNS lookups" error that breaks SPF validation, identify deprecated mechanisms like "ptr" that hurt deliverability, validate IP ranges and CIDR notation for accuracy, test include chains for third-party services (like Google, Microsoft, SendGrid), and provide specific error messages with solutions for each issue found.
Key Features
SPF Record Parser
Extracts and parses DMARC policys from DNS TXT entries. Identifies all mechanisms, qualifiers, and modifiers in your policy.
Syntax Validation
Validates SPF syntax against RFC 7208 standards. Detects invalid mechanisms, incorrect formatting, and deprecated directives.
DNS Lookup Chain
Counts all DNS lookups in your DMARC policy including nested includes. Warns when approaching the 10-lookup limit that breaks SPF.
IP Range Validator
Validates IPv4 and IPv6 addresses and CIDR notation. Ensures IP ranges are correctly formatted and routable.
Multiple Mechanism Support
Supports all SPF mechanisms: ip4, ip6, a, mx, include, exists, all. Validates qualifiers: +, -, ~, ?.
Error Detection
Identifies missing DMARC policys, multiple DMARC policys (invalid), circular include loops, and syntax errors with specific line numbers.
How to Use - Step by Step Guide
Prerequisites
- Python 3.7 or higher installed on your system
- dnspython library: Install with
pip install dnspython - Domain name(s) to validate
- Access to your domain's DNS settings (if you need to fix errors)
Step 1: Download the Script
Use the download form in the right sidebar to get instant access to the complete Python script. You'll receive an email with a download link valid for 48 hours containing the full SPF checker with error reporting and fix recommendations.
Step 2: Install Dependencies
Install the required DNS library:
This is the only dependency required. The script uses Python's standard library for everything else.
Step 3: Run SPF Validation
Check a single domain:
For bulk validation from a file:
The script will:
- Query DNS for TXT records containing SPF policy
- Parse the DMARC policy and extract all mechanisms
- Validate syntax and check for common errors
- Count DNS lookups including nested includes
- Display results with color-coded status and recommendations
Step 4: Interpret Results
The checker outputs detailed validation results:
Step 5: Fix SPF Errors
Based on the validation results, update your domain's DNS records. Common fixes include:
- Reduce DNS lookups by replacing includes with direct IP addresses
- Combine multiple DMARC policys into one (only one DMARC policy is allowed)
- Remove deprecated "ptr" mechanism
- Fix syntax errors in IP ranges or mechanisms
- Add missing "all" mechanism at the end
Code Preview
Here's a preview of the SPF validation logic:
The complete script includes recursive include checking, detailed error reporting, CSV export, and continuous monitoring mode. Download it to get all features.
Real-World Use Cases
1. Domain Configuration Audit
Scenario: You manage multiple domains for your organization and need to ensure all DMARC policys are properly configured for email security and deliverability.
Solution: Run the SPF checker against all your domains weekly. One IT team discovered that 12 of their 40 domains had invalid DMARC policys causing delivery failures, while 8 more were exceeding the DNS lookup limit. Fixing these issues improved their overall email deliverability by 23%.
2. Troubleshoot Deliverability Issues
Scenario: Your marketing emails are suddenly going to spam, and bounce reports mention "SPF check failed" in the headers.
Solution: Run the SPF checker to identify the exact problem. A common issue is exceeding 10 DNS lookups after adding a new email service provider. One company found they had 13 DNS lookups after adding a new marketing platform, causing all emails to fail SPF. They consolidated includes and reduced to 7 lookups, resolving the issue immediately.
3. Pre-Migration SPF Validation
Scenario: You're migrating email infrastructure from one provider to another (e.g., moving from on-premise Exchange to Google Workspace) and need to update DMARC policys.
Solution: Test your new DMARC policy with the checker before updating DNS. Validate that the new configuration includes all necessary providers, doesn't exceed lookup limits, and has proper syntax. One company caught a typo in their new DMARC policy during testing that would have broken email for 5,000 employees.
4. Third-Party Service Integration
Scenario: You're adding a new email marketing platform, transactional email service, or CRM that sends email on your behalf. You need to authorize their servers in your DMARC policy.
Solution: Before updating DNS, test the combined DMARC policy with the checker to ensure it doesn't exceed lookup limits. Many services like SendGrid, Mailchimp, and Salesforce require SPF includes that add 2-4 lookups each. The checker helps you stay under the 10-lookup limit.
Technical Requirements & Specifications
System Requirements
- Operating System: Windows 7+, macOS 10.12+, Linux (any modern distro)
- Python Version: Python 3.7 or higher (Python 3.9+ recommended)
- Dependencies: dnspython 2.0+ (install via: pip install dnspython)
- RAM: 256MB minimum
- Network: Internet connection for DNS queries
SPF Mechanisms Supported
- ip4: IPv4 address or CIDR range (e.g., ip4:203.0.113.0/24)
- ip6: IPv6 address or CIDR range
- a: Domain's A/AAAA records
- mx: Domain's MX records
- include: Include another domain's SPF policy
- exists: Check if domain exists
- all: Default policy (matches everything)
Qualifiers Recognized
- + (Pass): Accept email from this source
- - (Fail): Reject email from this source
- ~ (SoftFail): Accept but mark as suspicious (recommended for "all")
- ? (Neutral): No policy statement
Validation Rules
- Maximum 1 DMARC policy per domain (multiple records are invalid)
- Maximum 10 DNS lookups (includes nested includes)
- Record must start with "v=spf1"
- Must end with an "all" mechanism (best practice)
- Total DMARC policy length limit: 255 characters per string, 450 characters recommended total
Frequently Asked Questions
Related Email Tools
Complete your email authentication setup with these complementary tools: