Gather information by using dig command in Kali Linux Guide 2021

Gather information using dig command in Kali Linux

Dig Command Overview

Dig command is used  to gather information about host addresses, mail exchange servers, name servers by sending query to the DNS Name server. This tool can be run by Linux or Mac OS. Simply this works with single domain name, to get the result of multiple domain you will have to run multiple queries.

Dig Command Options

To see the available options used to dig command, Open terminal and execute the following command

#dig -h

dig help

Dig Usage Instructions

#dig authority

dig authority

in the above command, the result indicates that the authoritative search went from ns2->ns1->ns4->ns3, that means name server 2 have more authority over the search according to the context of the domain name over name server 1.

Now lets fool around with some other commands

#dig nssearch  **searches for name servers**

dig nssearch

dig additional **controls all additional queries **

dig nssearch

dig nsid ** searches for the name servers ID**

dig nsid

Similarly , there are other options that can be used for several other purposes. Here we go folks yet another command prominent in information gathering.

What can I find using the dig command?

dig will let you perform any valid DNS query, the most common of which are:

  • A (the IP address),
  • TXT (text annotations),
  • MX (mail exchanges), and
  • NS nameservers.

Use the following command to get the addresses for

 dig A +noall +answer

Use the following command to get a list of all the mailservers for

 dig MX +noall +answer

Use the following command to get a list of authoritative DNS servers for

 dig NS +noall +answer

Use the following command to get a list of all the above in one set of results.

dig ANY +noall +answer 

Use the following command to query using a specific nameserver.


Use the following to trace the path taken.

 dig +trace

If you like our content, please consider buying us a coffee.
Thank you for your support!

Leave a Reply

Your email address will not be published. Required fields are marked *