How to Install dig on Windows 10

How to Install dig on Windows 10

Summary:

dig stands for Domain Information Groper and it’s a DNS lookup tool that is popular on Linux.

dig stands for Domain Information Groper and it’s a DNS lookup tool that is popular on Linux. The Windows NSLookup tool is the same DNS tool for Windows.

So, why would you use dig instead NSLookup tool on Windows? Well for one the dig tool is more flexible and powerful than it’s Windows counterparty.

To add the dig tool on Windows 10 we have to install BIND tools.

Step 1. Download BIND for Windows 10

Head over to the ISC website https://www.isc.org/download/#BIND and download the latest stabile version of BIND tools.

BINT tools stable version
BINT tools stable version

For Windows 10 we’re gonna download the 64-bit version.

BIND tools win 64-bit
BIND tools win 64-bit

Step 2. Install BIND Tools

After the download has finished, extract the ZIP file and run the BINDInstall as Administrator.

Run as Administartor
Run as Administartor

Windows (being the good protector it is 😀 ) is going to block the installer so go to More > Run anyway

Windows protected your PC
Windows protected your PC

make sure to select Tools only on the BIND installer:

BIND Installer
BIND Installer

If successful, you will see the message: “BIND installation completed successfully”.

Step 3.Add Dig to Windows Path

One more thing before we start using the dig tool: We need to add the bin dir (C:\Program Files\ISC BIND 9\bin) containing 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.

See also  CMD Shutdown - Shutdown Command Windows 10
add-dig-to-windows-path-variable
Windows PATH Variable

On New, paste the path to the installation: C:\Program Files\ISC BIND 9\bin

add-dig-to-windows-path-variable
BIND variable

Step 4. Using the dig command

In Order to run the dig command you can use either PowerShell or Windows CMD.

The basic usage is to specify the doamin name you want to lookup and the type of the redord that you want to query. Here are a few examples:

Find IPv4 address of a domain (A record):

dig A example.com
dig A record
dig A record

Find IPv6 address of a dig domain (AAAA record):

dig AAAA example.com
dig AAAA record
dig AAAA record

Keep the answer short:

dig AAAA example.com +short
dig +short
dig +short

We can specify the nameserver we’d like to query:

dig A example.com @8.8.8.8

looks up MX records:

dig mx example.com
dig MX records
dig MX records

The -x option performs a reverse lookup:

dig -x 8.8.8.8
reverse lookup
reverse lookup

Querying only the answer section:

dig example.com +nocomments +noquestion +noauthority +noadditional +nostats
Query the answer section
Query the answer section

For a more detailed guide on the dig command make sure to checkout the dig Wikipedia page.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.