Look up a domain's mail servers with nslookup
Query MX records from the command line to see which mail servers handle email for a domain.
01Command
$ nslookup -type=mx github.com02What it does
MX records tell mail servers where to deliver email for a domain. nslookup -type=mx queries exactly that record type, and each result includes a priority number (lower = preferred). It's the quickest way to check why mail bounces, to verify a domain's email setup, or to see whether a provider change has propagated. Replace the type to look up other records, e.g. -type=txt.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Nslookup - Query name serversEvidence: Documents nslookup interactive 'set type=' (e.g. set type=MX) to query MX records and other record types for a domain.
- nslookup (Windows Commands)Evidence: Official nslookup reference documents set type=<record type> (including MX) for querying specific DNS record types of a domain.
Last verified: 2026-09-19 · Category: Network
06Related solutions
Purge cached DNS lookups so Windows re-resolves hostnames from scratch — the fix for 'the new server is live but my browser still hits the old one'.
The modern, scriptable replacement for nslookup: ask for exact record types, hit specific DNS servers, and see TTLs as objects.
One command that shows OS version, install date, boot time, memory, network adapters and installed hotfixes.