Look up the MX (Mail Exchange) records for any domain to see which mail servers handle its incoming email. Useful for email deliverability troubleshooting, DNS verification, and fraud detection. No sign-up required.
Enter any domain name to find its mail servers
Every domain that receives email has MX records in the global DNS system. We query those records in real time to return the full list of mail servers for any domain.
When you enter a domain, we issue a live DNS query for its MX records — the same type of query your mail server makes before delivering email. Results come directly from the authoritative DNS servers, not from a stale database.
MX records are returned sorted by priority (lowest number = highest priority). Mail servers try each record in order — primary first, then fallbacks. This lets you instantly see the preferred and backup mail servers for any domain.
Each MX record's hostname points to a mail server that accepts email for the domain. The TTL value tells you how long the record is cached. Results are cached for 5 minutes to keep lookups fast for popular domains.
If email sent to a domain bounces or goes missing, the first thing to check is its MX records. Missing, misconfigured, or stale MX records are a top cause of email delivery failures. Verifying MX records is step one in any deliverability audit.
A domain claiming to be a legitimate business but pointing its MX records to a free consumer email provider is a red flag. Domains with no MX records cannot receive email at all — a signal worth flagging in signup and checkout flows.
When migrating email providers or setting up a new domain, verifying MX records confirms the DNS changes have propagated correctly. Check before and after a migration to confirm the new mail server is live and the old one is removed.
Integrate MX record lookups directly into your application. Simple REST API returning JSON — no SDK required.
https://ip-api.io/api/v1/dns/mx/{domain}
Returns all MX records for a domain, sorted by priority ascending. Rate limited by IP address — no API key required for free-tier use. Results are cached for 5 minutes.
{
"domain": "gmail.com",
"mx_records": [
{ "priority": 5, "hostname": "gmail-smtp-in.l.google.com.", "ttl": 300 },
{ "priority": 10, "hostname": "alt1.gmail-smtp-in.l.google.com.", "ttl": 300 },
{ "priority": 20, "hostname": "alt2.gmail-smtp-in.l.google.com.", "ttl": 300 },
{ "priority": 30, "hostname": "alt3.gmail-smtp-in.l.google.com.", "ttl": 300 },
{ "priority": 40, "hostname": "alt4.gmail-smtp-in.l.google.com.", "ttl": 300 }
]
}
domain
The domain name that was queried
mx_records
Array of MX records sorted by priority ascending (empty if none found)
mx_records[].priority
MX record priority — lower number means higher preference
mx_records[].hostname
Fully-qualified hostname of the mail server
mx_records[].ttl
Time-to-live in seconds — how long DNS resolvers cache this record
curl "https://ip-api.io/api/v1/dns/mx/gmail.com"
import requests
response = requests.get("https://ip-api.io/api/v1/dns/mx/gmail.com")
data = response.json()
print(f"Domain: {data['domain']}")
for record in data['mx_records']:
print(f" Priority {record['priority']}: {record['hostname']} (TTL {record['ttl']}s)")
const response = await fetch("https://ip-api.io/api/v1/dns/mx/gmail.com");
const data = await response.json();
console.log(`Domain: ${data.domain}`);
for (const record of data.mx_records) {
console.log(` Priority ${record.priority}: ${record.hostname} (TTL ${record.ttl}s)`);
}
Start using IP-API.io to make your website safer and more user-friendly. Keep out unwanted bots, show visitors content that's relevant to where they are, and spot risky IP addresses quickly. It's perfect for making online shopping more personal and keeping your site secure. Get started today with one of the plans!
Everything you need to know about MX records and mail server lookups
An MX (Mail Exchange) record is a DNS record that specifies the mail servers responsible for receiving email on behalf of a domain. Every domain that receives email must have at least one MX record pointing to a mail server. MX records include a priority value — lower numbers mean higher priority — so email is delivered to the preferred server first, with fallback servers used if the primary is unavailable.
You can look up MX records using the free tool on this page — just enter any domain
name and click Look Up MX. The tool queries the live DNS system and returns all
MX records with their priority and hostname. For programmatic access, use the
ip-api.io MX Record API at
GET https://ip-api.io/api/v1/dns/mx/{domain} which returns results as JSON.
You can also use the command-line tool dig gmail.com MX or
nslookup -type=MX gmail.com for one-off lookups.
MX record priority is a number that determines which mail server email is sent to first. Lower numbers mean higher priority. For example, if a domain has MX records with priorities 10 and 20, sending mail servers try priority 10 first. If it is unavailable, they fall back to priority 20. Multiple records with the same priority value receive mail in round-robin fashion for load balancing. Gmail, for example, uses priorities 5, 10, 20, 30, and 40 across its five mail servers.
Yes. MX records reveal which email provider a domain uses. A domain claiming to be from a major enterprise but pointing its MX records to a free consumer email provider is a fraud signal. Domains with no MX records cannot receive email at all, which is suspicious for any domain claiming to be a legitimate business. Combining MX record lookups with domain age checks and IP fraud detection gives you a strong anti-phishing signal.
Yes, the interactive MX record lookup tool on this page is completely free with no sign-up required. API access for developers requires a paid subscription and returns JSON results with priority, hostname, TTL, query time, and cache status.
Explore how IP-API.io can enhance your security, provide robust bot protection, and improve IP geolocation accuracy for your applications.
Contact SupportCustomize your experience with tailored plans that fit your IP security and geolocation needs.
Email Us