What is nslookup?
A command-line program called nslookup can be used to find the IP address or DNS record
associated with a certain domain name. Additionally, it enables reverse DNS lookup, which
enables you to identify the domain linked to an IP address. Enter “nslookup” into the
Command Prompt or Terminal to begin using the utility.
List of nslookup Commands
There are various types of nslookup commands for requesting different domain information.
The most commonly used commands include:
- name – shows information about the domain name or hostname using the default
server. - server name – sets a different default DNS server using the current one’s information.
- root – assigns the root server as the default.
- set type= – queries a specific DNS record type, such as A, MX, PTR, or SOA. Use ANY to display all server records.
- set debug – displays debugging information about each query and its corresponding
response. - set recurse – asks the DNS nameserver to query other servers if it can’t provide the
information. - help – shows a list of nslookup commands and their functions.
- exit – quits the nslookup tool and returns users to the CLI.
How to Use the nslookup Command
Nearly every operating system’s command-line program, such as Windows’ Command Prompt
or Linux and macOS’s Terminal, can be used to perform nslookup searches.
Although nslookup seems slightly different on different OSs, it functions similarly on them.
Here’s how it appears, for instance, in Linux: