Mailbeam
API · DNS

MX Record Verification API

MX records tell you whether a domain has mail infrastructure. Mailbeam checks this as the first pass in every verification and returns the result in a single API call.

What Mailbeam checks

Every verification runs 7 checks in parallel and returns a structured result in under 100ms.

DNS MX lookup per request

Every verify call performs a live MX record lookup for the email's domain. Results for common domains are cached to reduce DNS query overhead.

Multiple MX record handling

Domains with multiple MX records (priority-ordered) are handled correctly. Mailbeam resolves each MX host to confirm it resolves to a real IP.

mx_check boolean in response

The `mx_check` field in the verify response tells you specifically whether the domain has valid MX records, independent of the overall `valid` composite result.

Detects missing, broken, or misconfigured MX

Domains with no MX records, MX records pointing to non-existent hosts, or MX records with misconfigured TTLs are all flagged as MX failures.

Fast first-pass filter

An MX failure means the entire domain cannot receive email — there is no value in SMTP probing. The MX check short-circuits the pipeline and returns immediately for domains with no mail infrastructure.

Catch-all domain identification

The MX check feeds into catch-all detection. If MX passes and the SMTP probe accepts a random address too, the domain is flagged as catch-all and the score is capped.

How it works

1

Domain extracted from email

Mailbeam parses the email address and extracts the domain component (everything after @), handling edge cases like subdomains and internationalized domains.

2

DNS MX query executed

A DNS query is issued to the authoritative nameserver for the domain, requesting MX records. Results are cached per-domain with a TTL-respecting cache strategy.

3

MX records validated

Each returned MX record's hostname is resolved to confirm it points to a real IP address. MX records pointing to non-existent or parked hosts are treated as failures.

4

Result returned in verification response

The `mx_check` boolean is included in the verify response. If MX fails, the overall `valid` is false and SMTP probing is skipped — reducing latency for invalid domains.

Integrate in minutes

PHPPHP
<?php
require_once __DIR__ . '/vendor/autoload.php';

use Mailbeam\Client;

$mb = new Client(['api_key' => getenv('MAILBEAM_KEY')]);

function verifyRegistrationEmail(string $email): array
{
    $result = $mb->verify($email);

    if (!$result->mx_check) {
        return [
            'valid'   => false,
            'message' => 'Email domain does not have mail server records.',
        ];
    }

    if (!$result->valid) {
        $msg = 'Email address could not be verified.';
        if ($result->suggestion) {
            $msg .= " Did you mean {$result->suggestion}?";
        }
        return ['valid' => false, 'message' => $msg];
    }

    return ['valid' => true, 'score' => $result->score];
}

// Usage in a Laravel controller
public function register(Request $request)
{
    $check = verifyRegistrationEmail($request->input('email'));
    if (!$check['valid']) {
        return response()->json(['error' => $check['message']], 422);
    }
    // proceed with registration
}

When to use it

Filtering defunct company domains in B2B lists

When a company shuts down or is acquired, their email domain often loses its MX records. An MX check quickly identifies these dead domains in imported B2B lists.

Pre-filtering large lists before SMTP probing

If you are building your own verification pipeline and want to use Mailbeam just for DNS-level pre-filtering, the `mx_check` field gives you domain validity before SMTP-level work.

Debugging email delivery failures

When emails to a domain are bouncing, use the free MX checker tool or API to confirm the domain's mail server configuration is correct.

Domain validation at registration

If you require users to register with a work email, an MX check confirms the domain has mail infrastructure — a quick signal that the domain is a real company, not a made-up one.

Frequently asked questions

What is an MX record?

An MX (Mail Exchange) record is a DNS record that specifies the mail server responsible for accepting email on behalf of a domain. Without a valid MX record, a domain cannot receive email — emails sent to it will bounce immediately.

If MX check passes, does that mean the email address is valid?

No. MX success means the domain has mail infrastructure. Whether the specific mailbox (username@domain) exists is a separate check — that requires SMTP verification. An MX pass is necessary but not sufficient for deliverability.

Does MX checking work for all domains?

Yes. MX checking is a standard DNS operation that works for any publicly registered domain. The only exception is domains with restricted or private DNS that is not accessible from public resolvers.

Why might an MX record check fail for a domain that seems active?

Common causes: the domain recently changed mail providers and DNS propagation is still in progress; the domain uses SPF but incorrectly omitted MX records; or the MX record hosts are temporarily unreachable. Mailbeam returns `mx_check: false` in these cases.

Ready to integrate?

Free tier includes 1,000 verifications/month. No credit card required.