dig and nslookup both query DNS. The difference is how much control and detail they give you. For quick checks, either can work. For repeatable troubleshooting, dig is usually easier to script, read, and share.
Where nslookup is useful
- It is available by default on many Windows systems.
- It is good for a quick A record or MX record check.
- It is familiar to many help desk and network support teams.
Where dig is stronger
- It displays DNS sections and status details more clearly.
- It supports options such as
+trace,+short, and+dnssec. - It is easier to compare resolvers with
@resolversyntax. - It is widely used in Linux, macOS, infrastructure, and DNS provider documentation.
Practical recommendation
Use nslookup when you only need a quick answer from a machine that already has it. Use dig when you need to diagnose why the answer is wrong, empty, stale, or different between networks.
dig @1.1.1.1 example.com MX
nslookup -type=mx example.com 1.1.1.1