How to find a domain’s mail server and test it
Look up MX records, read their priorities, and check the servers accept encrypted connections.
Email and IT admins, developers4 min readUpdated
Short answer
Look up the domain’s MX records. Each one names a mail server and a priority number, and senders try the lowest number first. Then test each server: it should resolve to an address, accept a connection, offer STARTTLS with a valid certificate and have reverse DNS.
How email finds its way in
Reading MX records
- Each MX record has a priority (lower is tried first) and a hostname.
- Equal priorities share the load; a higher number is a backup.
- Google Workspace shows smtp.google.com (or the older aspmx.l.google.com set); Microsoft 365 shows yourdomain-com.mail.protection.outlook.com.
- The hostname reveals the mail provider, which is often the quickest way to tell who handles a company’s email.
Common MX mistakes
- An MX pointing at a CNAME or an IP address instead of a hostname with A or AAAA records. Both break the standard.
- Old MX records left behind after moving providers, so some mail goes to a server nobody reads.
- A backup MX with weaker spam filtering, which spammers target on purpose.
- A domain that sends no email should publish a null MX (priority 0, a single dot) to say so.
Testing the server
Server-to-server mail uses port 25, which most cloud and home networks block, so online tests often check the submission ports 587 and 465 instead. A good result shows the server’s greeting, STARTTLS offered, TLS 1.2 or 1.3, and a certificate that matches the hostname and hasn’t expired.
Questions people ask
Sources and further reading
Written by the middle.network team, who build and run these tools. Last checked 2026-11-21.