DNS Part 2 - Linux and Windows Command Line Utilties to perform DNS Lookups

DNS Part 2 - Linux and Windows Command Line Utilities to query DNS Server

Now we are going to deal with some command line utility 


1. Host 


  • Purpose - Dns Lookup Utility
  • Platform : linux
  • Usage : 


$ host google.com







2. Nslookup 


  • Purpose - Query Internet NameServers Interactively
  • Platform : Windows , Linux (does not support some features like ls)
  • Usage :


$ nslookup
>set type=A 
>google.com







Similarly you can try out to query other record type by replacing set type = A to set type=NS 

$nslookup
>set type=NS
>google.com



3. Dig 


  • Purpose - Advanced Dns Lookup Utility
  • Platform : Linux
  • Usage


Please note by default dig uses A type record querying 

$ dig google.com





If you want to query all types of records at once then use this command .

$dig ANY google.com


Hope you enjoyed this tutorial . In the next part  DNS Part 3 we will learn about some hacking techniques to query the dns server like zone transfers , dns bruteforcing ,etc .