Skip to content

What is NSLOOKUP Windows command?

The NSLOOKUP command in Windows is a powerful tool for performing DNS lookups. It allows users to query domain name servers to obtain information about IP addresses and domain names. By using nslookup, users can troubleshoot network connectivity, check DNS records, and diagnose DNS-related issues effectively. This command provides valuable information for network administrators, IT professionals, and anyone looking to understand and manage DNS settings on a Windows system.

Terminal window
nslookup [Option] [Parameter]
OptionDescription
-dEnables debugging mode
-nDisables the use of DNS server settings
-q=Sets the query type (e.g., A, NS, CNAME, PTR)
-recurseQueries the specified DNS server recursively
-timeout=Sets the query timeout in seconds
ParameterDescription
ServerSpecifies the DNS server to query
NameSpecifies the hostname to lookup
-port=Specifies the port number to use for the DNS connection
Terminal window
nslookup 8.8.8.8

Uses nslookup to resolve the IP address “8.8.8.8” to its corresponding hostname.

Terminal window
nslookup www.google.com

Queries the DNS server to find the IP address associated with the domain “www.google.com”.

Terminal window
nslookup
server 8.8.8.8
www.microsoft.com

Changes the DNS server to “8.8.8.8” and then looks up the IP address of “www.microsoft.com”.

Terminal window
nslookup -type=PTR 8.8.8.8

Performs a reverse lookup on the IP address “8.8.8.8” to find the associated hostname.

Terminal window
nslookup -type=all www.example.com

Retrieves all available information for the domain “www.example.com” from the DNS server.

To use the nslookup command in CMD, execute the following command:

Terminal window
nslookup google.com

How to perform a reverse DNS lookup with nslookup?

Section titled “How to perform a reverse DNS lookup with nslookup?”

To perform a reverse DNS lookup using nslookup in Windows CMD, use the following command structure:

Terminal window
nslookup <IP address>

How can I specify a different DNS server with nslookup?

Section titled “How can I specify a different DNS server with nslookup?”

To specify a different DNS server when using nslookup in Windows, you can use the following command format:

Terminal window
nslookup google.com <DNS server>

How do I query for specific types of DNS records with nslookup?

Section titled “How do I query for specific types of DNS records with nslookup?”

To query specific types of DNS records using nslookup in Windows CMD, use the following format:

Terminal window
nslookup -type=<record type> <domain>

How can I enable or disable the recursion feature in nslookup?

Section titled “How can I enable or disable the recursion feature in nslookup?”

To enable or disable the recursion feature in nslookup in Windows, use the following commands:

Terminal window
nslookup -recurse <domain>
nslookup -norecurse <domain>

How do I set a timeout value for nslookup queries in Windows?

Section titled “How do I set a timeout value for nslookup queries in Windows?”

To set a specific timeout value for nslookup queries in Windows CMD, use the following command structure:

Terminal window
nslookup -timeout=<value> <domain>

How can I perform a debug query using nslookup in Windows?

Section titled “How can I perform a debug query using nslookup in Windows?”

To perform a debug query using nslookup in Windows CMD, use the following command:

Terminal window
nslookup -debug <domain>

How to save nslookup query results to a text file?

Section titled “How to save nslookup query results to a text file?”

To save the nslookup query results to a text file in Windows CMD, you can use the following command structure:

Terminal window
nslookup google.com > nslookup_results.txt
  • Troubleshooting DNS-related issues
  • Checking DNS records for a domain
  • Finding the IP address associated with a domain
  • Verifying name resolution
  • Checking the DNS server configuration
  • Testing DNS server response times