Home / Networking Commands / dig (Linux)

dig

Domain Information Groper - DNS Lookup Tool

What Does It Do?

The dig command is a powerful DNS lookup utility used to query DNS name servers and retrieve detailed information about domain names, including A, AAAA, MX, NS, TXT, and other DNS records.

It's the preferred tool for DNS troubleshooting and provides much more detailed output than nslookup, making it essential for network administrators and developers.

Advertisement

[ Insert Google AdSense Banner Code Here ]

When Should I Use It?

DNS Lookups

Query DNS servers to resolve domain names to IP addresses.

Check DNS Records

View A, AAAA, MX, NS, TXT, CNAME, and other record types.

Troubleshoot DNS

Diagnose DNS issues and verify DNS configuration.

Query Specific Servers

Target specific DNS servers for testing and validation.

Common Commands

dig google.com

Query A records for google.com.

dig google.com MX

Query MX (mail exchange) records.

dig google.com NS

Query NS (name server) records.

dig google.com +short

Display short answer (IP address only).

dig @8.8.8.8 google.com

Query using Google's DNS server.

dig -x 8.8.8.8

Reverse DNS lookup for an IP address.

Try It Yourself

Practice using the dig command in the terminal below. Try typing dig google.com or dig google.com MX