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!

environmentVariables

Example on DNS query :

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

More informations at : Dig Manual Page

No comments: