Digging into DNS

For many years I have used CLI tool nslookup for grabbing any DNS related information. Recently I have switched to different tool called Domain Infromation Grabber or simply DIG. It is like a next gen nslookup as you will see it has many cool features. This short tutorial will show you how to install it under Windows machine.

First, you need to visit the ISC site at http://www.isc.org/downloads. Dig is part of bind installation package. At the time of writing this artice the current stable version is 9.9.6-P1. Choose you your architecture, I’ll go now with x64. Download & Unzip.

Dig requires to have MS C++ Redistributable installed, so install vcredist_x64 first. Now copy dig.exe and all .dll files into C:\Windows\System32\

Now when you are able to execute dig directly from command line:

dig-1Some basic task you can do with dig are standard IP name resolution.dig-3

As you see the output shows several sections. The information we are looking for is under ANSWER SECTION. This querry shows the IPv4 address of opendns.com. Without specifying any options the default DNS server is used. In this case it is 10.0.2.1.

If you want to point the DNS querry to particular DNS server, use @ option. In next example I am asking opendns DNS server about the same domain.

dig-4

To perform a reverse DNS querry, use -x option. Here I am asking the same server what does IPv4 address 67.215.92.210 resolve to. The answer is api.opendns.com.

dig-5

Last but not least, you can ask for mail server records MX. Which will return the mail server addresses that opendns.com domain uses.

dig-6

Dig has many great features, but these few should keep you going for a while. There are also sites such as kloth.net that provide DIG services.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s