How to : Run dig on Windows
Dig is a nice linux/unix tool to query dns servers which is included by default in most linux distribution. You can get dig from BIND which is provided by the ISC ftp://ftp.isc.org/isc/bind/. Just grab the zip file for the latest version and extract the following files to c:\dig (or any folder that suits your need)
dig.exe
libbind9.dll
libdns.dll
libeay32.dll
libisc.dll
libisccc.dll
libisccfg.dll
liblwres.dll
If you intend to use dig alot I suggest that you add it’s folder to your path for more convenience.
Open a command prompt and go to c:\dig and type “dig www.google.com”. You should see something like this :
C:\dig>dig www.google.com ; <<>> DiG 9.4.2 <<>> www.google.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 470 ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;www.google.com. IN A ;; ANSWER SECTION: www.google.com. 10182 IN CNAME www.l.google.com. www.l.google.com. 193 IN A 72.14.205.147 www.l.google.com. 193 IN A 72.14.205.99 www.l.google.com. 193 IN A 72.14.205.103 www.l.google.com. 193 IN A 72.14.205.104 ;; Query time: 15 msec ;; SERVER: 10.150.250.1#53(10.150.250.1) ;; WHEN: Sun Mar 02 00:28:44 2008 ;; MSG SIZE rcvd: 116 C:\dig>
This is the basic syntax to make basic queries:
dig [domain] [query type] @[nameserver]
Here is a small list of sample query you can give to dig in your everyday use.
When no query type is specified dig will return the “a” record(s) for the domain from your configured name server
dig google.com
This return the mx records for google.com and the “a” records for each mx from your configured name server
dig google.com mx
This will query the name server 198.235.216.130 for “a” records of the domain google.com
dig google.com a @198.235.216.130