Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

Nslookup Command in Windows: Tips and Examples

Understand Nslookup Command in Windows with clear explanations, practical examples, and useful tips. This updated guide covers the essential concepts and...

Table of Contents

Nslookup Command in Windows is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.

(Applies to Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012)

Display information that you can use to exploit Domain Name System (DNS) infrastructure information.Before using this tool, you should be familiar with how a DNS works.The nslookup command tool is only available if you have the TCP / IP protocol installed.

Syntax nslookup command

 nslookup [] [{| -}] 

 nslookup / exit 

 nslookup / finger [] [{[>] | [>>]}] 

 ?} 

 nslookup / ls [] [{[>] | [>>]}] 

 nslookup / lserver 

 nslookup / root 

 nslookup / server 

 nslookup / set [=] 

 nslookup / set all 

 nslookup / set class = 

 nslookup / set [no] d2 

 nslookup / set [no] debug 

 nslookup / set [no] defname 

 nslookup / set domain = 

 nslookup / set [no] ignore 

 nslookup / set port = 

 nslookup / set querytype = 

 nslookup / set [no] recurse 

 nslookup / set retry = 

 nslookup / set root = 

 nslookup / set [no] search 

 nslookup / set srchlist = [/ .] 

 nslookup / set timeout = 

 nslookup / set type = 

 nslookup / set [no] vc 

 nslookup / view 

The nslookup command parameter

Parameters

Describe

The command nslookup exit

Exit nslookup.

Finger nslookup command

Connect to finger server on current computer.

nslookup help

Show a brief summary of extra commands in nslookup.

nslookup ls

List information for a DNS domain name.

nslookup lserver

Change the default server to the designated DNS domain.

nslookup root

Change the default server to the server for the root of the DNS domain space.

nslookup server

Change the default server to the designated DNS domain.

nslookup set

Changing configuration settings affects search functionality.

nslookup set all

Print the current values of configuration settings.

nslookup set class

Or change the query class.This class specifies the protocol group of information.

nslookup set d2

Enable or disable comprehensive debugging mode.All fields of each package will be printed.

nslookup set debug

Enable or disable debugging mode.

nslookup / set defname

Enable or disable the default DNS domain debugging mode for a single component lookup request.A single component is a component that does not containspaces.

nslookup set domain

Change the default DNS domain name to the specified name.

nslookup / set ignore

Ignore the packet truncation errors.

nslookup set port

Change the default DNS / UDP name server port to the specified value.

nslookup set querytype

Change the type of resource record for queries.

nslookup set recurse

Request DNS name server to query other servers if the server has no information.

nslookup set retry

Install the number of retries.

nslookup set root

Change the name of the original server used for queries.

nslookup set search

Add DNS domains in the DNS domain search list on request until the answer is received.This applies when the request is placed and searched contains at least a certain amount of time, but does not end with aspace.

nslookup set srchlist

Change the default DNS domain name and search list.

nslookup set timeout

Change the first number of seconds to wait for a reply to the request.

nslookup set type

Change the resource record type for the query.

nslookup set vc

Specify to use or not to use virtual circuits when sending requests to the server.

nslookup view

Arrange and list the output of sub-commands or previous ls commands.

Nslookup command comment

1. If computerTofind is an IP address and the query is for an A or PTR resource record type, the computer's name will be returned.If computerTofind is the name and there is no space, the default DNS domain name will be added to the name.This action will depend on the status of the following subset commands: domain, srchlist, defname andsearch.

2. If you type a hyphen (-) instead of computerTofind, the command prompt will switch to nslookup interactive mode.

3. Command line length must be less than 256 characters.

4. nslookup has two modes: interactive and non-interactive (interactive and noninteractive).If you only need to search for a separate piece of data, use non-interactive mode.For the first parameter, enter the name or IP address of the computer you want to look up.For the second parameter, enter the name or IP address of the DNS identifier server.If you omit the second argument, nslookup will use the default DNS name server.If you need to look up more than one piece of data separately, you can use interactive mode.Type the hyphen (-) for the first parameter and the name or IP address of the DNS name server for the second parameter, or ignore both parameters and nslookup will use the default DNS name server.Here are some tips on how to work in interactive mode:

  • To interrupt interactive commands at any time, press CTRL + B.
  • To exit, enter exit.
  • To handle a built-in command as a computer name, precede it with an escape character ().
  • An unrecognized command will be interpreted as a computer name.

5. If the lookup request fails, nslookup will print an error message.The following is a list of possible error messages:

timed out : The server did not respond to requests after a certain time and a certain number of retries.You can set the timeout period using the set timeout sub command.

No response from server: There is no DNS name server running on the server computer.

No records: DNS name servers do not have the resource records of the current query type for the computer, although the computer name is valid.The query type is specified with the set querytype command.

Nonexistent domain:   Computer or DNS domain name does not exist.

Connection refused:   Connection denied.

-Or-

Network is unreachable: Cannot make a connection to a DNS name server or finger server.This error typically occurs with ls and finger requests.

Server failure: The DNS name server has found internal inconsistencies in its database and cannot return a valid answer.

Refused: The DNS name server refused to serve the request.

format error: The DNS server recognizes that the requested package is not in the proper format.It may indicate an error in nslookup

For more information about nslookup and DNS commands, refer to the following sources:

  • Lee, T., Davies, J. 2000. Microsoft Windows 2000 TCP / IP Protocols and Services Technical Reference .Redmond, Washington: Microsoft Press.
  • Albitz, P., Loukides, M. and C. Liu.2001. DNS and BIND, Fourth edition.Sebastopol, California: O'Reilly and associates, Inc.
  • Larson, M. and C. Liu.2001. DNS on Windows 2000 .Sebastopol, California: O'Reilly and associates, Inc.

The nslookup command example

  • The nfsstat command in Windows
  • The nlbmgr command in Windows
  • Netcfg command in Windows
  • Nbtstat command in Windows
  • Bitsadmin create command in Windows

FAQ

What should you know about nslookup command comment?

1. If computerTofind is an IP address and the query is for an A or PTR resource record type, the computer's name will be returned.If computerTofind is the name and there is no space, the default DNS domain name will be added to the name.This action will.

What is Nslookup Command in Windows?

Nslookup Command in Windows refers to the core ideas, tools, or processes explained in this guide. Understanding the basics makes the more advanced details easier to apply.

Why is Nslookup Command in Windows important?

A clear understanding of Nslookup Command in Windows helps you make informed decisions, avoid common mistakes, and use the relevant tools or techniques more effectively.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.