Visit complete Cyber Security roadmap

← Back to Topics List


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.


  • DNS Querying: dig can retrieve various types of DNS records such as A, AAAA, MX, NS, CNAME, and many others.
  • Flexibility: With various command-line options, dig allows users to customize their queries easily.
  • User-friendly Formatting: dig provides readable and straightforward responses, simplifying the interpretation of DNS records and related information.
  • Batch Mode: The tool enables users to perform multiple DNS queries in a batch file, increasing efficiency.

Basic Usage

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


This command will return the A (IPv4) record for

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

dig AAAA

Common Options

Some common options to use with dig include:

  • +short: Condenses the output, providing only essential information.
  • -t: Specifies the type of DNS record to query (e.g., A, AAAA, MX, NS, etc.).
  • +tcp: Forces dig to use TCP instead of the default UDP for the DNS query.


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.

Community is the 6th most starred project on GitHub and is visited by hundreds of thousands of developers every month.

Roadmaps Best Practices Guides Videos Store YouTube by Kamran Ahmed

Community created roadmaps, articles, resources and journeys to help you choose your path and grow in your career.

© · FAQs · Terms · Privacy


The leading DevOps resource for Kubernetes, cloud-native computing, and the latest in at-scale development, deployment, and management.