Nslookup

From HackOps
Jump to navigation Jump to search

Nslookup

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.

Common Options

Query Types

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)

Server & Control

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

Output & Debug

Option Description
-debug Show detailed query information
-sil Run in silent mode without prompts or banners

Examples

Query A Record

nslookup -type=A example.com

Query AAAA Record

nslookup -type=AAAA example.com

Query CNAME Record

nslookup -type=CNAME www.example.com

Query MX Record

nslookup -type=MX example.com

Query SOA Record

nslookup -type=SOA example.com

Query TXT Record

nslookup -type=TXT example.com

Use Specific DNS Server

nslookup example.com 1.1.1.1

Enable Debug Mode

nslookup -debug example.com

See Also