Query Internet name servers
Syntax: nslookup nslookup host-to-find nslookup server interactive mode: nslookup -server nslookup [-options] [host-to-find ] Options: 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 options domain , srchlist , defname , and search. To look up a host not in the current domain, append a period to the name. server domain lserver domain Change 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. root Change 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 filename The default output contains host names and their Internet addresses. Option can be one of the following: -t querytype list all records of the specified type (see querytype below). -a list aliases of hosts in the domain; synonym for '-t CNAME ' -d list all records for the domain; synonym for '-t ANY' -h list CPU and operating system information for the domain; synonym for '-t HINFO' -s list 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 filename Sort and lists the output of previous ls command(s) with more(1). set keyword [= value ]
This command is used to change state information that affects the lookups. run man nslookup for a full list of valid keywords. set all Print the current value of the frequently-used options to set Information about the current default server and host is also printed. help ? Print a brief summary of commands. exit Exit the program.
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.
The options listed under the 'set ' command can be specified in the .nslookuprc file in the user's home directory (listed one per line). Options can also be specified on the command line if they precede the arguments and are prefixed with a hyphen.
"He who listens to truth is not less than he who utters truth" ~ Kahlil Gibran
Related linux commands:
named(8), resolver(3), resolver(5).
Equivalent Windows command: NSLOOKUP - Lookup IP addresses on a NameServer.