dig, short for the Domain Information Groper, is a powerful and flexible command-line tool used to perform DNS queries and obtain valuable information about domains, IPs, and DNS records. This utility, available on UNIX-based systems like Linux and macOS, provides an essential function to help diagnose and resolve various issues related to domain name resolution and network connectivity. It is highly useful for network administrators and cybersecurity professionals when troubleshooting DNS-related problems.


Basic Usage

Here’s a basic example of how to use dig to perform a DNS query:

dig example.com

This command will return the A (IPv4) record for example.com.

To perform a specific type of DNS query, such as fetching an AAAA (IPv6) record, use the following command:

dig example.com AAAA

Common Options

Some common options to use with dig include:


In summary, dig is a valuable command-line tool for performing DNS queries and troubleshooting domain name resolution problems. Its power and flexibility make it an essential tool for any network administrator or cybersecurity professional.