How to Use the dig Command

dig is a command that sends DNS queries and shows the results. Here are the basics and the forms you will use most.

Use dig in your browserFree, no sign-up

Basic forms

dig example.com          # A record
dig example.com MX       # specify the type
dig example.com TXT +short   # show only the value
dig @8.8.8.8 example.com     # specify the DNS server to ask
dig -x 8.8.8.8               # reverse lookup (PTR)
dig example.com NS +trace    # follow the chain from the root

How to read the output

The answer appears in the ANSWER SECTION. From left to right it shows the name, TTL, IN, type and value. A status: of NOERROR means success, NXDOMAIN means the name does not exist, and SERVFAIL means the server failed. If flags contains aa, the answer came from the authoritative DNS server.

Main options

What about Windows?

Windows doesn’t come with dig. The built-in nslookup is a close substitute (nslookup -type=MX example.com). If you use WSL, you can use dig too. If installing it is a hassle, looking things up in your browser with Web dig is an easy alternative.

How it maps to Web dig

For the kinds of records, see the list of DNS record types.

FAQ

Which operating systems have dig?

It comes built in on Mac and Linux. Windows doesn’t include it, so use nslookup or WSL.

What is the difference between dig and nslookup?

Both look up DNS, but dig gives more detailed output and has more options.

Use dig in your browser

More guides

Last updated: 2026-10-21