nslookup – query Internet name servers interactively
nslookup [-option … ] [host-to-find | –[server ] ]
Nslookup is a program to query Internet domain name servers. Nslookup has two modes: interactive and non-interactive. Interactive mode allows the user to query name servers for information about various hosts and domains or to print a list of hosts in a domain. Non-interactive mode is used to print just the name and requested information for a host or domain.
host [server ]Look up information for host using the current default server or using server , if specified. If host is an Internet address and the query type is A or PTR , the name of the host is returned. If host is a name and does not have a trailing period, the default domain name is appended to the name. (This behavior depends on the state of the set optionsdomain , srchlist , defname , and search .
To look up a host not in the current domain, append a period to the name.
lserver domainChange the default server to domain ; lserver uses the initial server to look up information about domain while server uses the current default server. If an authoritative answer can’t be found, the names of servers that might have the answer are returned.rootChanges the default server to the server for the root of the domain name space. Currently, the host ns.internic.net is used. (This command is a synonym for “lserver ns.internic.net ” The name of the root server can be changed with the “set root ” command.finger [name ] [> filename ]
finger [name ] [>> filename ]
Connects with the finger server on the current host. The current host is defined when a previous lookup for a host was successful and returned address information (see the “set querytype=A ” command). The name is optional. > and >> can be used to redirect output in the usual manner.ls [option ] domain [> filename ]
ls [option ] domain [>> filename ]
List the information available for domain , optionally creating or appending to filenameThe default output contains host names and their Internet addresses. Option can be one of the following:
- -t querytype
- lists all records of the specified type (see querytype below).
- lists aliases of hosts in the domain; synonym for “-t CNAME ”
- lists all records for the domain; synonym for “-t ANY ”
- lists CPU and operating system information for the domain; synonym for “-t HINFO ”
- lists well-known services of hosts in the domain; synonym for “-t WKS ”
When output is directed to a file, hash marks are printed for every 50 records received from the server.
view filenameSorts and lists the output of previous ls command(s) with more(1).help
?Prints a brief summary of commands.exitExits the program.set keyword [= value ]
This command is used to change state information that affects the lookups. Valid keywords are:
- Prints the current values of the frequently-used options to set Information about the current default server and host is also printed.
- class= value
- Change the query class to one of:
- the Internet class
- the Chaos class
- the MIT Athena Hesiod class
- wildcard (any of the above)
The class specifies the protocol group of the information.
(Default = IN ; abbreviation = cl