MX records tell the world where to deliver email for a domain. NSLOOKUP lets you view them in seconds, which makes it one of the fastest ways to troubleshoot email delivery problems.
Introduction
When someone sends an email to you@example.com, their mail server doesn’t know where to deliver it. It asks DNS, and DNS replies with the mail servers responsible for that domain.
If those records are missing, wrong, or still pointing at an old provider, email can bounce, arrive late, or vanish.
Checking MX records with NSLOOKUP takes less than a minute, and it’s often the first step when email stops working.
What Is an MX Record?
MX stands for: Mail Exchanger
An MX record tells other mail servers which server accepts email for your domain. Each record has two parts:
✅ Preference (priority): a number. The lowest number is tried first.
✅ Mail exchanger: the hostname of the mail server.
A domain can have several MX records. If the first server is unavailable, senders try the next one in priority order.
Checking MX Records (Quick Method)
Step 1
Open Command Prompt (Windows) or Terminal (Mac/Linux).
Step 2
Type:
nslookup -type=mx example.com
Replace example.com with the domain you want to check.
Example output (illustrative):
Non-authoritative answer:
example.com MX preference = 10, mail exchanger = mail1.example.com
example.com MX preference = 20, mail exchanger = mail2.example.com
In this example, mail is delivered to mail1 first. If it’s unavailable, mail2 is tried.
Checking MX Records (Interactive Method)
You can also use NSLOOKUP in interactive mode, which is handy if you want to check several domains.
- Type: nslookup
- Type: set type=mx
- Type the domain name: example.com
- Type another domain to check it too
- Type exit when you’re finished
Understanding the Results
Priority Numbers
preference = 10 is tried before preference = 20
Lower number = higher priority. The exact numbers don’t matter, only their order.
Common Providers
The hostnames in the results can tell you who handles a domain’s email:
✅ Microsoft 365: something like yourdomain-com.mail.protection.outlook.com
✅ Google Workspace: hostnames ending in google.com (such as aspmx.l.google.com)
✅ Other hosting providers: a hostname belonging to the host, such as mail.yourhost.com
This is a quick way to confirm that a domain’s email is pointing at the provider you expect, especially after a migration.
Checking Against a Specific DNS Server
Your normal DNS server may hold an old (cached) answer. To ask a different server:
nslookup -type=mx example.com 8.8.8.8
Here, 8.8.8.8 is Google’s public DNS service. If the results differ from your normal DNS server, you may be looking at a caching or propagation delay.
To go straight to the source, you can query the domain’s own name servers:
- Find them: nslookup -type=ns example.com
- Query one directly: nslookup -type=mx example.com ns1.exampleprovider.com
This shows what the domain is actually configured to return, rather than a cached copy.
Troubleshooting Email Problems
The Problem
A user reports:
“I’m not receiving email” or “Emails sent to us are bouncing.”
Investigation
Run: nslookup -type=mx example.com
Successful Result
MX records are listed and point to your email provider.
DNS is probably not the problem. Look at mailbox settings, spam filtering, or the mail service itself.
Failed or Suspicious Results
| What you see | What it likely means |
|---|---|
| No MX records, only SOA/name server details | The domain has no MX records, so email may not be delivered |
| “Non-existent domain” | The domain doesn’t exist or is mistyped |
| “DNS request timed out” | The DNS server isn’t responding, so try another one |
| MX points to your old provider | The records weren’t updated after a migration |
| Different results on different DNS servers | A recent change is still propagating |
Don’t Forget to Check the Mail Server Itself
An MX record points to a hostname, and that hostname must resolve to an IP address. To confirm:
nslookup mail1.example.com
If this fails, mail can’t be delivered even though the MX record looks correct.
Also remember:
✅ MX records should point to a hostname, not directly to an IP address
✅ MX records should not point to a CNAME record
✅ After changing MX records, allow time for DNS caching (TTL) to expire
Tips for Home Users
If you use a custom domain with email, such as a family address, NSLOOKUP can help you:
✅ Confirm your email provider’s settings were entered correctly
✅ Check whether a domain you’re emailing actually accepts mail
✅ Verify changes after switching email providers
Tips for IT Professionals
✅ Verify MX records before and after a mail migration
✅ Compare results across multiple public DNS servers to check propagation
✅ Confirm there are no leftover MX records pointing to a decommissioned provider
✅ Pair MX checks with SPF, DKIM, and DMARC reviews (these are TXT records: nslookup -type=txt example.com)
When Should You Use NSLOOKUP for MX Records?
✅ Email isn’t arriving
✅ Emails to a domain are bouncing
✅ After changing email providers
✅ Verifying DNS changes
✅ Checking which service hosts a domain’s email
Key Takeaway
MX records decide where a domain’s email goes, and NSLOOKUP lets you see them instantly. With a single command, nslookup -type=mx yourdomain.com, you can confirm whether email is pointed at the right provider, spot missing or outdated records, and tell whether a delivery problem starts with DNS or somewhere else.
