Invalid DKIM signatures cause email authentication failures. Studies show that 25% of domains have DKIM misconfigurations 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 DKIM Checker solves this problem by validating your domain's DomainKeys Identified Mail 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 DKIM Checker?
The DKIM Checker is an email authentication validation tool that analyzes your domain's DKIM (DomainKeys Identified Mail) records - the DNS TXT records containing public keys used to verify email signatures on behalf of your domain. When email servers receive mail from your domain, they check the DKIM record to verify the sender is legitimate.
How it works: The script queries your domain's DNS TXT records, extracts the DKIM signature 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 DKIM records 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 DKIM record 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 DKIM records, multiple DKIM records (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 DKIM signature
- Parse the DKIM record 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 DKIM records into one (only one DKIM record 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 DKIM records 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 DKIM records 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 DKIM records.
Solution: Test your new DKIM record 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 DKIM record 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 DKIM record.
Solution: Before updating DNS, test the combined DKIM record 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 DKIM signature
- 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 DKIM record 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 DKIM record 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: