Sunday, July 27, 2008

How to perform DNS query from your command prompt

If you are familiar with Linux network administrative, you will find that it will be more troublesome when you switched over to Windows based administration...I believe some of you who have the same experience will agree with me. :P

Now we can also perform DNS query ( e.g. dig, whois etc. ) from Windows command prompt, instead of browse to online webpage or SSH into the Linux server.

How to install the DNS query tool

  • Download the package from here or here and unzip it to C:\dig.
  • Edit the resolv.conf and replace the nameserver to your DNS server.
  • Save and copy the resolv.conf to C:\Windows\System32\drivers\etc
  • Go back to C:\dig, right click the doshere.inf and select Install.
  • Edit the Environment Variables ( can be found under [Control Panel]-->[System]-->[Advanced] )
  • Edit the "Path" and append "C:\dig" at the end of the line.
  • Now, you should be able to use the DNS query from command prompt!


Example on DNS query :

  • Show the name servers that controlling .my domains
    • dig my. NS
  • Show the name servers that controlling
    • dig NS
  • Show the Mail Exchange for
    • dig MX
  • Show the IP address for the web,
    • dig
  • Show the hostname of the IP address
    • dig -x
  • Show whois is owning the domain
    • whois

More informations at : Dig Manual Page

No comments: