Before sending email campaigns to thousands of contacts, there's one critical question you need to answer: Will your emails actually be delivered? The most common reason for email bounce rates above 10% is simple - the domains you're sending to have invalid or misconfigured MX (Mail Exchange) records.

Our MX Record Checker solves this problem by querying DNS servers to verify that each domain has valid mail exchange records configured. This ensures you're only sending emails to domains that can actually receive them, protecting your sender reputation and saving you money on wasted email sends.

Whether you're an email marketer cleaning lists before campaigns, a sales professional validating lead quality, or a developer building email verification systems, this tool identifies undeliverable domains in seconds instead of waiting for bounce reports days later.

What is an MX Record Checker?

An MX Record Checker is a DNS validation tool that queries domain name servers to retrieve Mail Exchange (MX) records - the DNS entries that specify which mail servers are responsible for accepting email on behalf of a domain. When you send an email to user@example.com, email servers first look up example.com's MX records to know where to deliver the message.

How it works: The script performs DNS queries using Python's dnspython library, retrieves all MX records for a domain, sorts them by priority (lower numbers indicate higher priority), validates the response to ensure records exist and are properly formatted, and generates detailed reports showing each mail server and its configuration.

What makes this tool unique is its ability to process thousands of domains in minutes with parallel DNS queries, detect common misconfigurations like missing or circular MX records, provide actionable insights about mail server priorities and backup servers, and export results in CSV format for easy integration with your email platform or CRM.

500K+ Domains Validated
95% Bounce Reduction
100/sec Check Speed

Key Features

Complete MX Resolution

Retrieves all MX records for each domain including primary and backup mail servers. Shows priority values to understand mail routing hierarchy.

Bulk Domain Validation

Process thousands of domains from CSV files with parallel DNS queries. Validates 100+ domains per second on average hardware.

Error Detection

Identifies common issues like NXDOMAIN (domain doesn't exist), SERVFAIL (DNS server errors), and TIMEOUT (slow DNS responses).

Priority Sorting

Automatically sorts MX records by priority value. Helps understand which server handles incoming mail first and backup server failover order.

CSV Export

Export validation results to CSV with domain, status, MX records, and priority values. Ready to import into your email platform.

Detailed Reports

Generate summary statistics showing valid domains, invalid domains, domains with multiple MX records, and average DNS response time.

How to Use - Step by Step Guide

Prerequisites

  • Python 3.7 or higher installed on your system
  • dnspython library: Install with pip install dnspython
  • List of domains to validate (text file or CSV)
  • Active internet connection for DNS queries

Step 1: Download the Script

Enter your details in the download form on the right sidebar. You'll receive instant access to the complete Python script with full error handling, progress tracking, and export functionality.

Step 2: Prepare Your Domain List

Create a text file or CSV with one domain per line. The script accepts various formats:

example.com gmail.com yahoo.com invaliddomainxyz123.com postigo.io

You can also extract domains from email addresses - the script automatically strips the email prefix and validates just the domain portion.

Step 3: Run the MX Checker

Open your terminal and execute:

python mx_checker.py domains.txt

For bulk processing with CSV export:

python mx_checker.py domains.csv --output results.csv --threads 50

The script will:

  1. Load all domains from your input file
  2. Query DNS servers in parallel for faster processing
  3. Validate MX records and detect errors
  4. Sort records by priority for each domain
  5. Display real-time progress with success/failure counts

Step 4: Interpret the Results

The script outputs detailed information for each domain:

example.com: VALID MX Records (2): 10 mail1.example.com 20 mail2.example.com invaliddomainxyz123.com: INVALID Error: NXDOMAIN (Domain does not exist) yahoo.com: VALID MX Records (3): 1 mta5.am0.yahoodns.net 1 mta6.am0.yahoodns.net 1 mta7.am0.yahoodns.net

Step 5: Clean Your Email List

Use the validation results to remove invalid domains from your email lists. Domains marked as INVALID should be excluded from campaigns to maintain sender reputation and reduce bounce rates.

Pro Tip: Run MX validation before every major email campaign. Domains can lose MX records due to DNS misconfigurations, expired registrations, or business closures. Weekly validation ensures your list stays clean.

Code Preview

Here's a preview of the core MX checking functionality:

#!/usr/bin/env python3 """ MX Record Checker - Email Domain Validator Checks MX records for bulk domain validation """ import dns.resolver from concurrent.futures import ThreadPoolExecutor import csv def check_mx_records(domain): """Check MX records for a domain""" try: # Query MX records mx_records = dns.resolver.resolve(domain, 'MX') # Extract and sort by priority records = [(r.preference, str(r.exchange).rstrip('.')) for r in mx_records] records.sort() return { 'domain': domain, 'status': 'VALID', 'mx_count': len(records), 'records': records } except dns.resolver.NXDOMAIN: return { 'domain': domain, 'status': 'INVALID', 'error': 'Domain does not exist' } except dns.resolver.NoAnswer: return { 'domain': domain, 'status': 'INVALID', 'error': 'No MX records found' } except Exception as e: return { 'domain': domain, 'status': 'ERROR', 'error': str(e) } # Bulk processing with threading def bulk_check(domains, max_workers=50): """Check multiple domains in parallel""" with ThreadPoolExecutor(max_workers=max_workers) as executor: results = list(executor.map(check_mx_records, domains)) return results # Full implementation in downloaded script...

The complete script includes CSV import/export, progress bars, error logging, and configurable timeout settings. Download it to get the full-featured version.

Real-World Use Cases

1. Pre-Campaign Email List Validation

Scenario: You're launching a cold email campaign to 10,000 B2B prospects. Your email service provider charges per email sent and penalizes accounts with bounce rates above 5%.

Solution: Run your entire prospect list through the MX checker before importing to your ESP. In one real-world case, a user validated 10,000 domains and found 1,200 (12%) had invalid or missing MX records, saving $600 in sending costs and protecting their sender reputation.

2. Lead Quality Verification

Scenario: Your sales team buys lead lists from third-party providers, but you suspect many emails are fake or expired.

Solution: Validate all domains before adding leads to your CRM. One sales team discovered that 30% of purchased leads had non-existent domains, helping them negotiate refunds from lead vendors and establish quality requirements for future purchases.

3. Website Form Validation

Scenario: Users submit email addresses to your contact form, but many bounce when you try to reply. You need to catch invalid domains at submission time.

Solution: Integrate MX checking into your form validation logic. Check the domain's MX records before accepting the submission. This reduces fake signups by 40% and improves your email deliverability for genuine contacts.

4. Email Deliverability Monitoring

Scenario: You maintain a large subscriber database and want to identify domains that may have delivery issues before sending campaigns.

Solution: Schedule weekly MX validation on your entire database. Monitor domains that transition from valid to invalid - these may indicate business closures or server migrations. One e-commerce company reduced bounce rates from 8% to under 2% with automated weekly validation.

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 (install via: pip install dnspython)
  • RAM: 512MB minimum (for processing 100K+ domains)
  • Network: Stable internet connection for DNS queries

DNS Query Configuration

  • Default timeout: 5 seconds per query
  • Retry attempts: 3 (for handling transient DNS failures)
  • Supported DNS servers: Public resolvers (Google 8.8.8.8, Cloudflare 1.1.1.1) or custom
  • Query type: MX (Mail Exchange) records

Performance Specifications

  • Processing speed: 50-100 domains/second with parallel queries
  • Batch size: Unlimited (tested with 1M+ domains)
  • Thread pool: Configurable (default 50 concurrent threads)
  • Memory usage: ~1MB per 1000 domains

Output Formats

  • Console: Real-time colored output with progress tracking
  • CSV: Domain, Status, MX Count, MX Records, Priority Values
  • JSON: Structured data for API integration
  • Log files: Detailed error logs for troubleshooting

Frequently Asked Questions

Q: What's the difference between checking MX records and full email validation?
MX record checking only verifies that a domain can receive email by checking DNS configuration. It doesn't verify if a specific email address exists on that domain. Full email validation includes MX checks plus SMTP verification to confirm the mailbox exists. MX checking is faster (100+ domains/sec) and doesn't trigger spam filters like SMTP verification can.
Q: Why do some domains have multiple MX records?
Multiple MX records provide redundancy and load balancing. The priority number (10, 20, 30) indicates which server receives mail first. Lower numbers = higher priority. If the primary server (priority 10) is down, mail is routed to the secondary server (priority 20). Large organizations like Google and Microsoft use multiple MX records for reliability.
Q: Can this tool check if an email address exists, not just the domain?
No, this tool only validates domain-level MX records. To verify individual email addresses exist, you need SMTP verification (see our Email List Validator tool). However, MX checking is 90% faster and avoids the risk of being flagged as a spammer by target mail servers.
Q: How often should I validate MX records for my email lists?
For active campaigns, validate weekly. For cold outreach lists, validate immediately before sending. Domains can lose MX records due to expired registrations, server migrations, or business closures. Regular validation maintains list quality and sender reputation. Automated weekly checks catch issues before they impact deliverability.
Q: What does "SERVFAIL" mean in the results?
SERVFAIL indicates the DNS server encountered an error while processing your query. This usually means temporary DNS issues, misconfigured nameservers, or DNSSEC validation failures. Domains with SERVFAIL should be re-checked after a few hours. If the error persists for 24+ hours, the domain likely has serious DNS problems and emails won't be delivered.
Q: Does checking MX records trigger spam filters?
No. MX record lookups are standard DNS queries that don't connect to mail servers or attempt to send email. They're completely passive and undetectable by the target domain. Unlike SMTP verification which connects to mail servers and can trigger rate limits, MX checking is safe to run at high volumes.
Q: Can I use custom DNS servers instead of public resolvers?
Yes! The script supports custom DNS resolver configuration. You can specify your company's internal DNS servers, use privacy-focused resolvers, or configure multiple fallback servers. Instructions for custom DNS configuration are included in the downloaded script.

Related Email Tools

Enhance your email validation workflow with these complementary tools: