Home > Microsoft, Network > Getting DIG to work on Windows

Getting DIG to work on Windows

March 14th, 2009

As a network engineer, there are a number of tools that are absolutely critical to my job, that I use on a daily basis.  One of those tools named “dig”, is included as part of the BIND package from the Internet Systems Consortium (ISC).  For those not familiar with “dig”, it is a command line query tool used to troubleshoot DNS issues.

Due to my need to support a number of specialty applications, I run a Windows PC as my main work laptop.  This is unfortunate as Microsoft’s command line diagnostic tools (such as nslookup) are quite weak.  While I could SSH into a Linux/Solaris/whatever host each time I need to troubleshoot something, I often find myself on foreign networks with only my trusty laptop available.  A number of years ago I figured out how to get dig running on my Windows machines and have never looked back.

To run dig on a Windows box you could install the full windows version of BIND (which includes dig), but that is quite overkill if all you want is dig.  Instead, I recommend downloading the latest stable precompiled windows binaries of BIND, extracting the .zip, and then copying the files listed below into your c:\windows directory (really you could put them anywhere in your PATH but c:\windows is easy and I doubt the filenames will ever conflict).

  • dig.exe
  • libisc.dll
  • libdns.dll
  • libeay32.dll
  • libbind9.dll
  • libisccfg.dll
  • liblwres.dll

Voila!  You can now run dig from the command prompt!

C:\Users\eric.rosenberry>dig bitplumber.net

; <<>> DiG 9.6.0-P1 <<>> bitplumber.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1886
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;bitplumber.net.                        IN      A

;; ANSWER SECTION:
bitplumber.net.         14400   IN      A       75.119.216.176

;; Query time: 210 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sun Mar 15 00:05:54 2009
;; MSG SIZE  rcvd: 48
C:\Users\eric.rosenberry>

-Eric

eprosenx Microsoft, Network

  1. December 10th, 2009 at 05:50 | #1

    Good how-to. Thanks

  2. jamkomo
    February 20th, 2010 at 15:46 | #2

    Did you put your company’s nameservers in \windows\system32\drivers\etc?

  3. February 20th, 2010 at 15:51 | #3

    @jamkomo
    I did that a long time ago the first time I installed DIG on Windows, but since then it seems to have “just worked”. I think it reads the system DNS servers as the default if that file does not exist.

    -Eric

  1. No trackbacks yet.