Frequently Asked Question

What is the difference between dig, nslookup, and host?

All three query DNS, but dig (Domain Information Groper) is the modern, detailed tool of choice. It comes from BIND, prints the full response with headers, flags, and timing, and supports every record type and option you might reasonably want. dig google.com returns A records by default; dig google.com MX asks for mail exchangers, dig google.com AAAA for IPv6, dig @8.8.8.8 google.com forces a specific server, and dig +short strips the ceremony for scripting. dig +trace walks the resolution path from the root.

nslookup is the older, terser tool that still ships on most systems. It is considered deprecated for new work but is what most ad-hoc tutorials still show. host is a tiny one-line wrapper, useful when you just want the answer fast. For anything where you might need to read the full response, diagnosing a missing record, checking which server answered, inspecting TTLs, reach for dig.

Further reading and video