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.

WindowsnetworkcmdDNSLow risk
Run: nslookup -type=mx github.com — the MX records and their priorities are printed below.

01Command

Command
$ nslookup -type=mx github.com

02What 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

RiskLow risk
!Warning: Results come from your DNS resolver; a freshly changed MX record may still show the old value until its TTL expires.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Nslookup - Query name servers
    SS64.com · technical · 2026-09-17
    Evidence: Documents nslookup interactive 'set type=' (e.g. set type=MX) to query MX records and other record types for a domain.
  • nslookup (Windows Commands)
    Microsoft Learn · vendor-doc · 2026-09-17
    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