XiaTools

Free Tools vs. Terminal Commands: Best Ways to Inspect DNS Mail Exchangers

By Rohit, founder of XiaTools · Updated 18 Oct 2026

Finding the best MX lookup tool online helps you quickly diagnose email delivery failures, verify domain configurations, and ensure your mail servers are reachable. Mail Exchange (MX) records determine which servers accept incoming emails for a domain, making them critical for business communication. Whether you prefer a lightning-fast browser utility or a granular command-line tool, inspecting these records is an essential network administration skill.

Understanding MX Records and Email Delivery

When a sender dispatches an email to user@example.com, their sending mail server queries the Domain Name System (DNS) for the domain's MX records. These records point to the fully qualified domain names of the receiving mail servers and assign each a priority integer. Lower integers indicate higher priority, dictating which server the sending MTA (Mail Transfer Agent) should try first.

example.com.    3600    IN    MX    10 mail.example.com.
example.com.    3600    IN    MX    20 backup.example.com.

If the primary mail server (mail.example.com) is offline or rejecting connections, the sending server automatically falls back to the secondary server (backup.example.com). Misconfigured priorities, missing records, or unreachable destination IPs result in bounced emails and communication blackouts. Regular inspection ensures your mail flow remains robust and uninterrupted.

Using the Best MX Lookup Tool Online

Web-based utilities provide instant visibility into your mail exchangers without requiring command-line familiarity. To run a quick inspection, use the MX Lookup tool, which queries global DNS resolvers to display active mail servers, their priorities, and corresponding IP addresses in seconds.

Web-based tools shine when you need to check a domain from an external network perspective to bypass local caching issues. They often perform extra diagnostic checks, such as testing SMTP banner responses or verifying reverse DNS (PTR) alignment on the returned mail server IPs.

Step-by-Step Web Inspection Guide

  1. Open your web browser and navigate to the diagnostic utility.
  2. Enter your target domain name (e.g., example.com) into the search input field.
  3. Click the query or lookup button to initiate the request.
  4. Review the returned table showing hostnames, priority values, and target IP addresses.
  5. Check for any warning flags indicating missing records or invalid target hosts.

Inspecting MX Records via Terminal Commands

While web utilities offer convenience, network engineers often rely on native terminal commands for deeper scriptable inspection. Depending on your operating system, several utilities are available to query mail exchangers directly from the shell.

Using Dig on Linux and macOS

The dig (Domain Information Groper) command is the industry standard for querying DNS name servers. To check MX records for a domain, run the following command in your terminal:

dig example.com MX +noall +answer

Sample output:

example.com.		3600	IN	MX	10 mail.example.com.
example.com.		3600	IN	MX	20 backup.example.com.

To trace the IP addresses of those mail exchangers simultaneously, you can issue a standard lookup or query the specific records using administrative flags.

Using Nslookup on Windows

Windows environments feature the built-in nslookup utility. By default, running nslookup enters an interactive shell, but you can perform single-line queries by specifying the record type explicitly.

nslookup -type=MX example.com

Sample output:

Server:  dns.google
Address:  8.8.8.8

Non-authoritative answer:
example.com     MX preference = 10, mail exchanger = mail.example.com
example.com     MX preference = 20, mail exchanger = backup.example.com

mail.example.com        internet address = 192.0.2.10
backup.example.com      internet address = 192.0.2.20

Feature Comparison: Web Tools vs Terminal Commands

Choosing between a browser-based utility and a terminal command depends on your immediate troubleshooting goals. Both methods offer distinct advantages in different scenarios.

Feature Web-Based Tools Terminal Commands (dig / nslookup)
Setup Requirement None (Runs in browser) Operating system shell access
Speed Instantaneous, single-click Fast, requires typing parameters
Additional Checks Often includes SMTP connectivity & IP reputation Pure DNS query only
Automation Difficult to script Easily integrated into bash or PowerShell scripts
Local Caching Risk Bypasses local machine cache Subject to local OS and resolver caching

Common Mistakes and How to Fix Them

Troubleshooting DNS mail exchangers often involves navigating a few frequent pitfalls that can obscure the true state of your mail flow.

  • Targeting a CNAME Record: Pointing an MX record to a target domain that utilizes a CNAME (Canonical Name) record violates strict DNS RFC specifications. Always ensure your MX records point directly to an A or AAAA record, never a CNAME.
  • Ignoring IPv6 (AAAA) Glue: Modern mail servers require proper IPv6 addressing if your mail transfer agent binds to IPv6 interfaces. Verify that your mail exchangers have matching AAAA records alongside standard A records, such as 2001:db8::10.
  • Forgetting TTL Caching: If you recently updated your mail exchangers at your DNS registrar, changes may take time to propagate globally due to Time-To-Live (TTL) caching on intermediate resolvers.

Quick MX Inspection Checklist

  • Verify domain spelling and syntax in your query input.
  • Confirm that at least one active MX record is present.
  • Check that priority integers correctly designate primary and fallback servers.
  • Ensure MX targets resolve to valid A or AAAA IP addresses.
  • Test direct SMTP connectivity to the resolved mail server IP on port 25.

Frequently asked questions

What does the priority number mean in an MX record?

The priority number determines the order in which sending mail servers attempt to deliver messages. Lower integer values represent higher priority servers, meaning an MTA will attempt delivery to a priority 10 server before falling back to a priority 20 server.

Why does my MX lookup show different results on my computer versus a web tool?

Discrepancies usually occur due to DNS caching. Your local operating system, router, or Internet Service Provider caches DNS queries for the duration of the record's TTL, whereas web tools typically query authoritative or public resolvers directly with zero local cache.

Can an MX record point directly to an IP address?

No, standard DNS specifications dictate that MX records must point to a valid host name (a domain name), not a raw IPv4 or IPv6 address. That hostname must then resolve to an IP address via separate A or AAAA records.

How long does it take for MX record changes to update globally?

Global propagation depends entirely on the Time-To-Live (TTL) value configured on your previous DNS records. If your old TTL was set to 3600 seconds (one hour), it may take up to that long for all global resolvers to respect the new changes.

Is it possible to check if the mail server is actually accepting mail after doing an MX lookup?

Yes, while an MX lookup only provides the server hostnames and IPs, you can test actual mail acceptance by connecting to port 25 using terminal tools like telnet or netcat to check for a valid SMTP service banner.

Related articles

Free tools