Why MX record failures in Mailgun logs disrupt your email deliverability

You send a campaign. The Mailgun dashboard says "delivered." But open rates stay flat. You check the logs—and buried in the JSON output, a single line says: "Failed to resolve MX record for [email protected]."

That one line tells you everything: your message never reached its intended server. MX record failures don’t just mean a bounce—they mean your sender reputation is already eroding. If you’re ignoring these messages in your Mailgun JSON logs, you’re leaving invalid domains in your list, and that’s a direct path to being throttled or blocked.

Mailgun logs are structured, but they’re noisy. The key isn’t just seeing the error—it’s knowing how to extract MX record failure signals from the JSON and turn them into actionable insights. That’s what we’ll walk through in detail.

Key takeaways

  • MX record failures in Mailgun JSON logs indicate domains with broken email infrastructure, leading to permanent bounces or routing delays.
  • These errors are encoded in the logs but require targeted filtering—often using field names like "error" or "smtp_response" with specific codes—to surface correctly.
  • Failing to extract and act on MX record errors means allowing misconfigured or non-existent domains to persist in your list, harming long-term deliverability and sender reputation.

What does an MX record failure error look like in Mailgun JSON format?

You’ll see an MX record failure in Mailgun’s JSON delivery logs when the delivery-status.code is 550 and the message says something like "5.1.1 The recipient address is not recognized". The details.smtp_error field often includes a more specific message like "5.1.1 <[email protected]>: Recipient address rejected: User unknown", and the error_type may be smtp_mx_failed. These signals confirm the delivery attempt failed at the SMTP level due to a rejected or unresolved recipient address.

Decoding Mailgun’s delivery-status structure

The delivery-status object in Mailgun’s JSON response is the primary source for diagnosing delivery issues. It includes code, message, and details. The code is a standard SMTP reply code — 550 means permanent failure. The message provides a human-readable summary, such as "Recipient address rejected." This helps quickly identify whether the issue is temporary (like a retryable error) or permanent (like a non-existent address).

Understanding error details for root cause analysis

The details object often contains the full SMTP error string under smtp_error. For example, "550 5.1.1 <[email protected]>: Recipient address rejected: User unknown" indicates the domain’s MX record resolved but the specific user was not found. If error_type is smtp_mx_failed, it means the resolver couldn’t reach the target domain’s MX records — possibly due to invalid DNS configuration or a typo in the address. This distinction matters because MX resolution issues aren’t the same as invalid user addresses.

When parsing logs at scale, look for 550 codes with message or smtp_error fields containing unknown, rejected, or not recognized. Such patterns signal dead or mistyped email addresses — a red flag for list hygiene. According to RFC 5321, SMTP codes in the 5xx range indicate permanent failures, which should trigger removal from your sending list.

For teams using Mailgun with large lists, validating addresses before sending is the most effective way to reduce these failures. Bulk email list cleaning identifies MX failures, catch-alls, and role addresses before they generate bounces. Catching these issues early avoids hit rates, protects sender reputation, and reduces wasted send volume.

How to extract MX failure errors from Mailgun’s JSON logs using a real-time verification API

You can extract MX failure errors from Mailgun’s JSON delivery logs by using Email List Validation’s real-time verification API to validate each address in your logs. Send each email through the verify endpoint, then filter responses for invalid or risky statuses with reason: 'mx_failed' or reason: 'dns_mx_lookup_failed'. This automates detection of DNS-level delivery issues without manual log parsing, turning raw bounce data into actionable hygiene insights.

Turn Mailgun’s raw logs into actionable list hygiene

  1. Extract email addresses from Mailgun’s JSON delivery logs where event is bounce or dropped, and isolate the recipient field. These are the candidates most likely to have failed due to MX or DNS issues.
  2. Send each address to Email List Validation’s real-time verification API using the verify endpoint. This immediately checks the domain’s DNS records and confirms SMTP connectivity to the mail server.
  3. Filter API responses for specific MX-related failures. Look for verdict: 'invalid' or verdict: 'risky' with reason: 'mx_failed' or reason: 'dns_mx_lookup_failed'. These indicate the domain has no valid MX records, an invalid setup, or a DNS lookup failure.
  4. Tag or isolate these addresses. Once identified, you can remove them from your list or flag them for further review. This prevents future sends to domains that cannot receive mail.
  5. Reprocess your list. After removing invalid addresses, retry delivery. You’ll see better inbox placement and lower bounce rates—consistent with standards from organizations like the Internet Engineering Task Force (RFC 5321), which defines SMTP behavior and DNS requirements for mail delivery.

Why this works where raw logs fall short

Mailgun logs alone don’t tell you why an email bounced. They may show a generic "550 5.1.1 User unknown" without revealing whether the domain’s MX record exists, is misconfigured, or is unreachable. DNS lookup failures (like dns_mx_lookup_failed) are common after domain changes or server reconfigurations, but they’re easily missed in raw logs.

Using the API adds precision. Unlike static checks, real-time validation confirms live server status and DNS integrity—critical for maintaining sender reputation. It’s an industry-standard practice: Spamhaus notes that improper DNS configuration is a leading cause of mail delivery failures.

Instead of parsing JSON manually or building a rules engine, you get consistent results with clear, structured output. This is faster, more accurate, and reduces false positives compared to relying solely on bounce codes.

What the 'MX record failed' verdict really means in Email List Validation

When Email List Validation returns an "MX record failed" verdict, it means the domain behind the email address either has no valid MX record or the record points to a server that doesn’t respond. This isn’t a temporary glitch—it’s a permanent configuration issue. Addresses with this verdict will never receive email, no matter how strong your sender reputation or how well-written your message is.

How MX records determine delivery capability

MX records are the core of email routing. They tell sending servers where to deliver mail. If a domain lacks an MX record, or if the record exists but points to a non-functional server, the email will not be delivered. This is not a filter decision—it’s a technical reality enforced by the SMTP protocol. The system simply cannot find a destination.

Let’s say you're sending to a user at [email protected]. If that domain’s DNS lacks an MX record, or the server specified in the MX record is offline, the delivery attempt fails at the very first step. This is not a spam or reputation issue—it’s a foundational email routing failure. It shows up in Mailgun JSON logs as 550 5.1.1: Recipient address rejected: User unknown, but with the underlying cause being a missing or unreachable MX record.

You can verify this by using a tool like MXToolbox to look up a domain’s DNS records. If no MX record is returned, or if the server listed is unreachable, the domain cannot receive email. This is why an "MX record failed" verdict in Email List Validation is a hard stop—not a soft flag.

Why it's not a temporary error

Unlike transient delivery failures—like a server being temporarily overwhelmed or a rate limit hit—an MX record failure is not recoverable by retrying. The domain’s DNS configuration must change. A failed MX record doesn’t imply a bad email, nor does it mean the user doesn’t exist as a person. It means the email address belongs to a domain that doesn’t have a functioning mail server.

This is a critical distinction. You may think a user’s email is just “blocked” or “inactive.” But if the MX record isn't pointing to a live server, that email address is functionally broken. It won’t receive anything. Even if you clean your sender reputation or rewrite your message, delivery will fail.

That’s why catching these issues early is essential. Use our bulk email list cleaning tool to find and remove all such addresses before you send. It saves time, reduces bounces, and improves your sender reputation with ISPs. An address with a failed MX record is a dead zone—you’re wasting every send attempt. Identifying it upfront is not optional; it’s fundamental.

A real-world case: How to debug a batch of Mailgun bounces with MX errors

When 15% of your Mailgun sends fail with a 550 5.1.1 error and error_type: smtp_mx_failed, it’s not just a random mail server hiccup — it’s a signal that your list contains addresses with broken or unreachable domains. Export the delivery logs, filter for mx_failed and 550 messages with unknown in the body, then run those addresses through a bulk verification tool. You’ll likely find that 12% were either misspelled, had invalid domains, or lacked valid MX records. Cleaning them out drops hard bounces to under 1% and protects your sender reputation. You’re not fixing a delivery problem — you’re fixing the source.

Step-by-step: Debugging MX errors in Mailgun logs

  1. Export and filter Mailgun logs. Pull the full JSON delivery log and filter entries where error_type contains mx_failed or code is 550 with message including unknown. This isolates SMTP-level failures due to domain resolution issues, not content or spam filtering.
  2. Extract suspect email addresses. Pull the recipient field from each filtered log row. These are the addresses that failed because their domain had no valid MX record or was unreachable during SMTP handshake — the root cause of 550 5.1.1.
  3. Validate them at scale. Use a bulk verification tool to test the extracted addresses. This is where Email List Validation’s accuracy shines: it checks whether the domain exists, has a valid MX record, and can receive mail — not just validity at the syntax level. Bulk validation helps you identify invalid domains, misspelled addresses, and catch-alls too.
  4. Remove invalid entries. Remove all addresses flagged as invalid, missing MX, catch-all, or disposable. This often removes 10–15% of your list — but the payoff is real: hard bounces drop from 15% to below 1%.
  5. Monitor sender reputation. After cleaning, monitor your deliverability. A stable bounce rate below 1% is a strong signal to email providers that you’re maintaining quality. According to RFC 5321, consistent high bounce rates are a primary factor in sender reputation degradation.

Why this works at scale

MX failures are often silent — they don’t trigger spam filters, just delivery failure. But they eat into sender reputation. A small number of unreachable domains can make your whole batch look suspect. By proactively verifying before sending, you avoid sending to broken infrastructure. Tools like Email List Validation don’t just catch typos — they validate DNS-level reachability, which is exactly what Mailgun’s SMTP layer checks. The result? Fewer blocked sends and higher inbox placement. You’re not just debugging — you’re preventing it.

How Email List Validation’s accuracy compares to raw log inspection

Parsing Mailgun JSON delivery logs only tells you when an email failed to deliver—usually at the SMTP level—but not why. You’ll see a bounce, but not whether the address was invalid, temporarily blocked, or never existed. Email List Validation goes beyond logs by combining real-time DNS lookups, SMTP checks, and anti-spoofing rules, achieving 98.9% accuracy in identifying valid, risky, and invalid addresses before you ever send. It distinguishes between temporary issues like greylisting and permanent failures like missing MX records with far greater precision than log analysis alone.

Why raw logs fall short

Mailgun logs show SMTP-level results: “550 User unknown” or “421 Service unavailable.” But these messages don’t reveal the root cause. A 550 could mean the user never existed, or it could mean the domain has strict greylisting policies—both end in failure, but only one is fixable. Without deeper analysis, you can’t sort false positives from real bounces, leading to wasted sends and damaged sender reputation.

Logs also lack context. A single bounce doesn’t tell you whether an address was mistyped, hosted on a disposable domain, or part of a role account like admin@ or sales@. These are red flags for deliverability, but not always visible in raw log output. Relying solely on logs means you’re guessing at the cause, not diagnosing the problem.

How Email List Validation adds clarity

Instead of waiting for delivery attempts, Email List Validation probes each address up front using live DNS records and connection trials. It checks for MX record presence, validates SPF and DKIM alignment, and identifies known disposable domains. This means you catch invalid emails before they hit your send queue.

For example, if an email has a valid MX record and a properly configured DNS setup but gets bounced due to greylisting, validation correctly flags it as “risky” rather than “invalid.” This level of granularity—separating temporary, recoverable problems from permanent failures—is rare in log-only systems. It’s why our accuracy reaches 98.9%: we don’t just validate syntax; we validate real-world deliverability.

Unlike many tools that depend on outdated blacklists or guesswork, our system uses a layered approach. We simulate the real email delivery path and detect common pitfalls like misspelled domains, role accounts, or spam traps. You can find the full list of what we check in our real-time verification API documentation. This kind of proactive validation reduces bounce rates and protects sender reputation much more effectively than reacting to logs after the fact.

When you’re working with Mailgun, logs alone aren't enough. The real insight comes from knowing *why* an email failed—and whether it ever had a chance. Understanding sender reputation and deliverability starts long before sending. For a deeper look at how these systems interact, see the SMTP specification (RFC 5321) and Return Path's research on email deliverability.

Integrating Email List Validation with Mailgun via API for proactive delivery health

When Mailgun logs show delivery failures, pull the email address and use Email List Validation’s API to instantly check if it’s invalid, a catch-all, or risky—before it harms your sender reputation. Automate this step via webhook or scheduled sync to stop bad addresses from slipping through, cutting cleanup time by up to 80%.

Set up the automation pipeline

  1. Configure Mailgun to forward delivery failure events (bounce or block events) to your system using webhooks, or set up a scheduled job to pull logs at regular intervals.
  2. Extract the email address from the JSON payload—specifically from the recipient field in the event object.
  3. Use the Email List Validation API to verify the address in real time. The API returns a clear verdict: valid, invalid, catch-all, risky, or unknown. This step takes less than 500ms per address.
  4. If the result is invalid or catch-all, flag the address in your CRM or list management tool. Use real-time verification API to process hundreds of addresses daily without delay.
  5. Automatically remove or quarantine the address before the next send, protecting your domain reputation and avoiding blacklists.

Why this matters: reputation is fragile

Even one invalid address can trigger a bounce loop or a block if your domain reputation is already under strain. According to Spamhaus, high bounce rates are a known vector for reputation damage—especially when they stem from invalid or non-existent addresses.

Most delivery failures come from old, mistyped, or intentionally unresponsive addresses. Without proactive filtering, you’re reacting to problems after reputation has already declined. By integrating validation into your Mailgun workflow, you’re not just cleaning lists—you’re defending your delivery health at scale.

Mailgun’s structured logs make this process reliable and reproducible. Combined with Email List Validation’s 98.9% accuracy, you reduce manual log analysis by up to 80%. The system runs silently—detecting and purging bad data before it ever reaches an inbox.

Why relying only on Mailgun logs won’t fix deliverability issues

Mailgun logs tell you an email failed to deliver, but they don’t reveal whether the address is permanently invalid, a typo, a role account, or a catch-all. Without deeper validation, you’re guessing at root causes and treating all bounces the same—many of which are recoverable with the right data. This leads to over-cleaning lists, missing valid leads, and declining sender reputation.

Mailgun logs don’t explain the failure

When you see an MX record failure in Mailgun’s JSON logs, it simply means the domain didn’t respond with a valid mail server configuration. But that could mean a typo in the email address, a temporary DNS glitch, or a domain that doesn’t accept mail at all. You can’t tell which from the log alone.

Let’s say you’re sending to [email protected]. Mailgun will flag this as a failure. But is it acme-example.com with a typo? Or acme.com with a missing MX record? Or a domain where no one checks the inbox? Without checking the domain’s actual MX configuration or testing the address live, you can’t know.

Some domains may return a generic 5xx error even if they accept mail—especially if they use catch-all setups or greylisting. This makes false positives common. You’re left filtering out a valid address because the log says "delivery failed" without context.

According to the RFC 5321 specification, SMTP servers should return specific error codes—for example, 550 for permanent failures, 4xx for transient issues. But Mailgun aggregates these into a basic failure message. This reduces diagnostic depth, especially for infrastructure issues like missing or misconfigured MX records.

IETF RFC 5321 details how mail transport should work; in practice, many providers don’t return granular errors, especially for domain-level problems.

Without real validation, you can’t prioritize or recover

Without verifying addresses ahead of time, you treat all bounces as equally problematic. That means you might remove valid leads because they bounced due to a role account like info@, while letting invalid or disposable emails persist.

For example, [email protected] might be a role account with no inbox—but Mailgun will still return a delivery error. You can’t distinguish that from a typo like [email protected]. One is recoverable; the other isn’t. But logs alone don’t help you decide.

Tools that analyze MX records and test addresses in real time can tell you if a domain has email infrastructure at all, whether an email is disposable, or if it’s likely to be deliverable. That context allows you to decide: remove the invalid, retry the temporary, and keep the valid.

Instead of reacting to failures, verify your list upfront. Clean your list in bulk with real-time validation before sending—so you catch MX record problems, disposable domains, and role accounts *before* they impact your deliverability and sender reputation.

How to build a repeatable process for monitoring MX failures in delivery logs

Set up a script to pull Mailgun delivery logs hourly, filter for 5xx bounces with mx_failed or dns_lookup_failed errors, extract the email addresses, verify them in bulk using an email verification API, store results with reason codes, and trigger alerts when failure rates exceed 0.5% in a batch. This process catches dead domains early, reduces sender reputation risk, and prevents future delivery failures.

Step-by-step automation process

  1. Fetch Mailgun logs programmatically every hour using the Mailgun API. Log retention is typically 30 days, so you’ll need to process data early to avoid gaps. Use the Mailgun API reference to structure your endpoint calls correctly.
  2. Filter logs for HTTP 5xx status codes and error types containing mx_failed or dns_lookup_failed. These codes indicate DNS-level issues—specifically that the receiving domain's MX record isn’t resolvable or unreachable. This narrows down invalidity to infrastructure problems, not just spam filtering.
  3. Extract the email addresses from each matching log entry. You can automate this using regex patterns like [^@]+@[^@]+\.[^@]+ but validate only addresses with the correct format to avoid false positives.
  4. Send the list to the real-time email verification API. It checks the same underlying signals as Mailgun—DNS validation, server responsiveness, and role account detection—giving you a second, independent signal on whether an address remains live.
  5. Store results in a centralized dashboard or database. Include email, verification status (valid/invalid/catch-all/risky), and the failure reason. This data becomes your primary source for detecting trends, like consistent failures from a single domain.
  6. Monitor batch-level failure rates. If more than 0.5% of verified addresses from the same batch return mx_failed results, trigger an alert. This threshold is based on industry standards—typical bounce rates above 0.5% signal deliverability issues.

Why this matters and how to scale it

MX record failures often stem from obsolete domains, misconfigured DNS, or non-existent email infrastructure. Letting them go unaddressed degrades sender reputation, especially with ISPs like Gmail and Outlook that track consistent DNS-level failures.

Use the bulk verification service at Bulk Email List Cleaning to process large batches. The service returns detailed failure reasons—including invalid_domain or no_mx_record—which aligns with Mailgun’s own errors, giving you a clean audit trail.

Integrate the workflow with your existing tools—Mailchimp, HubSpot, SendGrid via our integrations—to automate cleanup before sending. This isn’t about fixing the past. It’s about stopping failures before they happen.

Keep your logs and verification results versioned. Over time, you’ll spot patterns: specific domains fail repeatedly, or certain email patterns (like admin@) correlate with MX issues. That insight lets you refine your list hygiene rules.

The long-term benefit: reducing bounce rates and protecting sender reputation

You can reduce bounce rates and protect your sender reputation by identifying and removing email addresses with persistent MX record failures before they’re sent to. These failures signal invalid or non-existent destinations, which ISPs and spam filters track over time. Even a 1% bounce rate can trigger reputation penalties and lead to blocklisting, especially if consistent across multiple campaigns. Proactively cleaning your list using Mailgun JSON logs ensures better inbox placement and sustainable deliverability.

Why MX failures hurt sender reputation

MX record failures aren’t just technical hiccups—they’re red flags to major ISPs like Gmail, Yahoo, and Outlook. If your outbound emails consistently fail due to non-existent domains or misconfigured mail servers, it flags your sending behavior as unreliable. Over time, ISPs correlate high bounce volume with poor list hygiene, leading to throttling or outright blocklisting.

For example, industry standards from the Internet Engineering Task Force (IETF) define SMTP delivery as a multi-step process where MX validation is a foundational layer. When you bypass it with invalid addresses, you’re not just wasting bandwidth—you’re damaging trust metrics that ISPs rely on to judge email legitimacy.

How early detection preserves inbox placement

Let’s say your Mailgun delivery logs show repeated 550 5.1.1 User unknown errors with a specific domain. If you ignore those, you're likely sending to addresses that no longer exist—possibly even after the owner left the company. Left unchecked, these hard bounces accumulate, and your sender reputation takes a hit, even if they're just a few per thousand.

By extracting MX failure errors from the JSON logs and filtering those addresses out before delivery, you maintain clean list hygiene. This consistency signals to ISPs that your email list is managed, accurate, and respectful of end users. The result? Sustained inbox placement and fewer delivery interruptions.

You don’t need to wait for blacklists to appear. Catch these issues now—before they become reputation debt—using tools that validate emails in bulk or in real time. Clean your entire list to prevent MX failures from eroding sender trust over time.

Conclusion: Automate failure extraction, not just detection

MX record failures in Mailgun JSON logs point to invalid or unreachable domains, but they're a symptom of poor list quality—not the problem itself.

Instead of reacting to delivery failures, automate the extraction and classification of invalid addresses using Email List Validation. This identifies and removes problematic emails before they ever hit your send queue.

Proactive hygiene reduces bounces, improves sender reputation, and increases inbox placement—turning a reactive debugging task into a scalable defense.

Keep reading

Ready to put this into practice? Email List Validation verifies emails with 98.9% accuracy — start with 100 free verifications.

Frequently asked questions

What is the difference between an MX record failure and a hard bounce?

A hard bounce is a delivery failure due to non-existent or inactive mailboxes. An MX record failure is a configuration issue at the DNS level—no mailbox exists because no valid mail server is defined for the domain.

Can a valid email address have an MX record failure?

Yes—if the domain is misconfigured, even a real user may not receive mail. Email List Validation detects these cases by validating MX records before accepting an address as 'valid'.

How does Email List Validation detect MX record failures?

It performs live DNS queries for MX records and verifies the mail server responds to SMTP connection attempts. A non-responsive or missing MX record triggers an 'invalid' verdict.

Do I need to parse my entire Mailgun log to find MX failures?

No—use filters like `error_type` or `code` to isolate relevant entries. Then verify suspicious addresses via Email List Validation’s API or bulk checker to confirm their status.

Can MX failures be temporary?

In rare cases, an MX record may be misconfigured but recoverable. However, if the DNS record is missing or points to a dead server, the issue is permanent and should not persist in your mailing list.

How often should I verify my list to catch MX failures?

Run full verification quarterly or when adding new segments. After any high-bounce campaign, verify all failed addresses to prevent repeated failures.

Does Email List Validation flag role accounts or disposable domains?

Yes. It returns specific verdicts: 'role' for addresses like postmaster@ or info@, and 'disposable' for temporary email providers. These are not MX failures but are flagged for hygiene.

Is there a limit to how many addresses I can verify with Email List Validation?

No. You start with 100 free verifications, and purchased credits never expire. Bulk validation supports thousands of addresses per batch.

How does Email List Validation compare to Mailgun’s built-in bounce handling?

Mailgun detects bounces but doesn’t classify them. Email List Validation analyzes the root cause—like MX failures—providing actionable insights beyond SMTP status.

Can I integrate Email List Validation with SendGrid or HubSpot?

Yes. It supports integrations with SendGrid, Mailchimp, HubSpot, Klaviyo, and others. Use them for list hygiene before sending, reducing delivery issues at scale.