Windows Commands / IT Support Guides
Check DNS answers with nslookup
Use nslookup to see what a DNS resolver returns for a host or mail domain.
Environment and inputs: Windows 11 · Command Prompt unless PowerShell is specified
Understand the problem
Run Command Prompt on the affected Windows machine. Choose the exact domain name you need to check.
Run the command
The first command looks up addresses for the name. The second specifically requests mail exchange records, known as MX records.
nslookup example.com
nslookup -type=MX example.com
Read the output
Read the server at the top as the resolver used for the query. Read the answer below it for the requested name. An MX record points to a mail server. Lower preference numbers are tried first.
Choose the next step
If the answer is unexpected, verify the spelling, record type and resolver. Compare with the expected answer for that network, especially when using a VPN or an internal domain.
Before making changes
Record the queried name, record type, resolver, time and answer. A DNS result shows how the name is published or resolved, so check the application connection separately.