How to Install dig on Windows 10
Domain Information Groper, commonly known as dig command is a DNS lookup utility that is popular on Linux. Dig tool is more flexible and better DNS tool than the Windows NSLookup tool.
Unfortunately, it isn’t shipped with Windows 10, but we can get a version of dig that runs on Windows 10 by installing BIND tools.
Download BIND for Windows 10
Open a web browser and navigate to www.isc.org/download/ and download the latest version of BIND.
For Windows 10, we need to download the 64bit zip file.
Install Bind Tools
After the download has finished, extract the ZIP file. Then right click on the BINDInsall and choose run as administrator.
Check the Tools only checkbox and click the Install button.
If successful, you will see the message: "BIND installation completed successfully".
Add Dig to Windows Path variable
There is one more thing, we need to add the bin directory (C:\Program Files\ISC BIND 9\bin) which contains the dig.exe file to the Windows PATH variable.
Right click on This PC and select Properties. Go to Advanced system settings > Environment Variables. Edit the PATH variable under the System variables.
Click the New button and paste the path C:\Program Files\ISC BIND 9\bin.
And that is all we need to do. In Order to run the dig command you can use either PowerShell or Windows CMD.
Using the dig command
The basic usage of the dig command is to specify the domain name you want to look up and the type of record you want to query (e.g. A for address records, MX for MX records). Let's see a couple of examples.
Find IP address of a website or domain (A record):
dig example.com A
Find IPv6 address of a domain (AAAA record):
dig example.com AAAA
We can specify the nameserver we’d like to query:
dig A example.com @22.214.171.124
looks up MX records:
dig mx example.com
The -x option performs a reverse lookup when you specify the IP address:
dig -x 126.96.36.199
Types of DNS records you can query include: A, AAAA, MX for Mail exchanger, NS, TXT.