Random header image

Quickly install DiG on Windows without a full BIND9 install

Today I needed to use - and install - DiG (Domain Information Groper!) on a Windows 10 box. Of course, Windows is useless when it comes to CLI tools - nslookup is past its prime and not even Windows 10 includes much by way of useful tools for DNS queries. It's shipped as part of the BIND9 DNS software from ISC.

So, let's see about DiG... Good news, everyone! - BIND9 is available for Windows, but I don't want to install the whole thing, ain't nobody got time for that. So, let's see about excerpting just the DiG executable and getting it so you can use it without specifying its full path every time, which will require setting its location in the PATH variable.

There's quite a few guides and tutorials to installing DiG on Windows. The simplest one I found was from Websistent, who recommended downloading their own zip of DiG and its necessary DLL dependencies, dropping those into windows\system32 (urk?) and using as normal.

We can do better than that:

  1. Download BIND9 from https://www.isc.org/download/ (grab the 32-bit or 64-bit Windows .zip distribution as necessary\)
  2. Extract this zip to a suitable folder. I tend to use C:\apps\ for this sort of stuff, so I would use C:\apps\utils\bind9 as my directory.
  3. For the finishing touch, edit your system's environment variables:
    1. Go Start → Run (or Ctrl + R), enter rundll32.exe sysdm.cpl,EditEnvironmentVariables and hit OK, or
    2. Open the Environment Variables applet via Control PanelAll Control Panel ItemsSystemAdvanced System Settings → Advanced tab, or
    3. Choose Change my environment variables from the Tasks section on the User Accounts control panel, or
    4. Use one of the many other options listed on this SU article
  4. Add the full path from Step 2 into the User variables "Path" entry:
Obviously, adjust the path as required.

After OKing that dialog and the underlying Environment Variables dialog, you should be able to immediately use DiG without typing a full path! Very handy.

No BIND installation required, no mucking about with DLLs in your system32 directory - easy as that, and very simple to update. I went with BIND9.14.3 but you can use whatever version you like. Congrats, your DiG installation on Windows is complete. Happy querying!

Leave a Reply

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

Notify me of followup comments via email. You can also subscribe without commenting.

I footnotes