NSLookup Command

NSLookup Command

NSLookup Overview

NSLookup (Name Server Lookup). NSlookup is a simple but very practical command-line tool which is used to find DNS records, or in other words, IP address that corresponds to a host or the domain name that corresponds to an IP address. Windows users can initiate this command via the command prompt and UNIX users via the terminal window. NSlookup command-line tool has two modes.

Interactive Mode – If you look up for only a single piece of data, use the non-interactive mode. For the first part of command after nslookup, type the name or IP address of the computer that you want to look up. For the second part, type the name or IP address of a DNS name server or fqdn.

Non interactive Mode – If you are looking for more than one piece of data, use interactive mode. Type a hyphen (-) for the first part and the name or IP address of a DNS name server for the second part. If you omit both parts, the tool uses the default DNS name server. Interrupt interactive commands by pressing CTRL+B and Exit by typing exit.

Authoritative – It contains information about the zone file.
Non-authoritative – When a name server is not in the list for the domain you did a lookup on.
Port – The DNS servers use port 53.

Syntax – Nslookup {parameters}

Related – DNS Interview Questions

NSLookup Parameters –

PARAMETER

DESCRIPTION

nslookup exitExits the nslookup command-line tool.
nslookup fingerConnects with the finger server on the current computer.
nslookup helpDisplays a short summary of subcommands.
nslookup lsLists information for a DNS domain.
nslookup serverChanges the default server to the specified DNS domain.
nslookup rootChanges the default server to the server for the root of the DNS domain name space.
nslookup serverChanges the default server to the specified DNS domain.
nslookup setChanges configuration settings that affect how lookups function.
nslookup set allPrints the current values of the configuration settings.
nslookup set classChanges the query class. The class specifies the protocol group of the information.
nslookup set d2Turns exhaustive Debugging mode on or off. All fields of every packet are printed.
nslookup set debugTurns Debugging mode on or off.
nslookup set domainChanges the default DNS domain name to the name specified.
nslookup set portChanges the default TCP/UDP DNS name server port to the value specified.
nslookup set querytypeChanges the resource record type for the query.
nslookup set recurseTells the DNS name server to query other servers if it doesn’t have the information.
nslookup set retrySets the number of retries.
nslookup set rootChanges the name of the root server used for queries.
nslookup set searchAppends the DNS domain names in the DNS domain search list to the request until an answer is received. This applies when the set and the lookup request contain at least one period, but do not end with a trailing period.
nslookup set srchlistChanges the default DNS domain name and search list.
nslookup set timeoutChanges the initial number of seconds to wait for a reply to a request.
nslookup set typeChanges the resource record type for the query.
nslookup set vcSpecifies to use or not use a virtual circuit when sending requests to the server.
nslookup viewSorts and lists the output of the previous subcommand or commands.

Download the NSLookup Parameter Table here.

Error message –

Error message occurs when nslookup command fails.

ERROR MESSAGE

DESCRIPTION

timed outThe server didn’t respond to a request after a certain amount of time and a certain number of retries. You can set the time-out period with the nslookup set timeout command. You can set the number of retries with the nslookup set retry command.
No response from serverNo DNS name server is running on the server computer.
No recordsThe DNS name server doesn’t have resource records of the current query type for the computer, although the computer name is valid. The query type is specified with the nslookup set query type command.
Non-existent domainThe computer or DNS domain name doesn’t exist.
Connection refused or Network is unreachableThe connection to the DNS name server or finger server could not be made. This error commonly occurs with finger requests.
Server failureThe DNS name server found an internal inconsistency in its database and could not return a valid answer.
RefusedThe DNS name server refused to service the request.
format errorThe DNS name server found that the request packet was not in the proper format. It may indicate an error in nslookup.

Download the NSLookup Error Message Table here.

Conclusion

NSlookup is widely used a command that lets you enter a hostname and find out the corresponding IP address or domain name system (DNS) record.

Leave a Comment

Your email address will not be published. Required fields are marked *

2 × four =

Shopping Cart
Scroll to Top