Nslookup is a DNS query tool used to retrieve domain information such as IP addresses, mail servers, and DNS record details. It is useful in both troubleshooting and reconnaissance workflows, allowing direct queries to specific DNS servers and record types. Nslookup supports both interactive and single-line modes.
Option |
Description
|
-type=A |
Query IPv4 address records
|
-type=AAAA |
Query IPv6 address records
|
-type=CNAME |
Query canonical name records
|
-type=MX |
Query mail exchange records
|
-type=SOA |
Query start of authority records
|
-type=TXT |
Query text records
|
-class=IN |
Set the DNS class (default: IN for Internet)
|
Option |
Description
|
SERVER |
Specify which DNS server to query
|
-port=<PORT> |
Use a custom port for the DNS query
|
-timeout=<SEC> |
Set the query timeout in seconds
|
-retry=<COUNT> |
Set the number of retry attempts
|
Option |
Description
|
-debug |
Show detailed query information
|
-sil |
Run in silent mode without prompts or banners
|
nslookup -type=A example.com
nslookup -type=AAAA example.com
nslookup -type=CNAME www.example.com
nslookup -type=MX example.com
nslookup -type=SOA example.com
nslookup -type=TXT example.com
nslookup example.com 1.1.1.1
nslookup -debug example.com