Developer's Daily | Unix by Example |
main | java | perl | unix | dev directory | web log |
NSLOOKUP(8) BSD System Manager’s Manual NSLOOKUP(8)
NAME
nslookup ? query Internet name servers interactively |
SYNOPSIS
nslookup [?option ...] [host-to-find | ?[server]] |
DESCRIPTION |
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. |
ARGUMENTS
Interactive mode is entered in the following cases: |
a)’ when no arguments are given (the default name server will beused),
b)’ when the first argument is a hyphen (-) and the second argument is the host name or Internet address of a name server. Non-interactive mode is used when the name or Internet address of the host to be looked up is given as the first argument. The optional second argument specifies the host name or address of a name server. The options listed under the ‘‘set’’ command below can be specified in the .nslookuprc file in the user’s home directory if they are listed one per line. Options can also be specified on the command line if they precede the arguments and are prefixed with a hyphen. For example, to change the default query type to host information, and the initial timeout to 10 seconds, type: |
nslookup -query=hinfo -timeout=10 |
INTERACTIVE COMMANDS
Commands may be interrupted at any time by typing a control-C. To exit, type a control-D (EOF) or type exit. The command line length must be less than 256 characters. To treat a built-in command as a host name, precede it with an escape character (.&) N.B.: unrecognized command will be interpreted as a host name. |
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 root’ Changes 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] ls [option] domain [> filename] ls [option] domain [>>
filename] ?t querytype ?a’ lists aliases of hosts in the domain; synonym for ‘‘?t CNAME’’. ?d’ lists all records for the domain; synonym for ‘‘?t ANY’’. ?h’ lists CPU and operating system information for the domain; synonym for ‘‘?t HINFO’’. ?s’ 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 filename help’ ?’ Prints a brief summary of commands. exit’ Exits the program. set keyword [=value] all’ Prints the current values of the frequently-used options to set. Information about the current default server and host is also printed. class=value IN’ the Internet class CHAOS’ the Chaos class HESIOD’ the MIT Athena Hesiod class ANY’ wildcard (any of the above) The class specifies the protocol group of the information. (Default = IN; abbreviation = cl) [no] debug (Default = nodebug; abbreviation = [no] d2 (Default = nod2) domain=name (Default = value from hostname(1), /etc/resolv.conf, or LOCALDOMAIN; abbreviation = do) srchlist=name1/name2/... set srchlist=lcs.MIT.EDU/ai.MIT.EDU/MIT.EDU sets the domain to lcs.MIT.EDU and the search list to the three names. This command overrides the default domain name and search list of the ‘‘set domain’’ command. Use the ‘‘set all’’ command to display the list. (Default = value based on hostname(1), /etc/resolv.conf, or LOCALDOMAIN; abbreviation = srchl) |
[no] defname
If set, append the default domain name to a single-component lookup request (i.e., one that does not contain a period). (Default = defname; abbreviation = [no] search (Default = search; abbreviation = port=value (Default = 53; abbreviation = po) querytype=value type=value A’ the host’s Internet address. CNAME’ the canonical name for an alias. HINFO’ the host CPU and operating system type. MINFO’ the mailbox or mail list information. MX’ the mail exchanger. NS’ the name server for the named zone. PTR’ the host name if the query is an Internet address; otherwise, the pointer to other information. SOA’ the domain’s ‘‘start-of-authority’’ information. TXT’ the text information. UINFO’ the user information. WKS’ the supported well-known services. Other types (ANY, AXFR, MB, MD, MF, NULL) are described in the RFC-1035 document. (Default = A; abbreviations = q, ty) [no] recurse (Default = recurse; abbreviation = retry=number (Default = 4, abbreviation = ret) root=host (Default = ns.internic.net.; abbreviation = ro) timeout=number (Default = 5 seconds; abbreviation = ti) [no] vc (Default = novc; abbreviation = [no] ignoretc (Default = noignoretc; abbreviation = DIAGNOSTICS |
If the lookup request was not successful, an error message is printed. Possible errors are: |
Timed out
The server did not respond to a request after a certain amount of time (changed with ‘‘set timeout=value’’) and a certain number of retries (changed with ‘‘set retry=value’’). No response from server No records Non-existent domain Connection refused Network is unreachable Server failure Refused Format error FILES |
/etc/resolv.conf’ initial domain nameand name server addresses
$HOME/.nslookuprc’ user’s initial options ENVIRONMENT |
HOSTALIASES’ file containing host aliases
LOCALDOMAIN’ overrides default domain SEE ALSO |
named(8), resolver(3), resolver(5); RFC-1034, ‘‘Domain Names - Concepts and Facilities’’; RFC-1035, ‘‘Domain Names - Implementation and Specification’’. |
AUTHOR
Andrew Cherenson 4th Berkeley Distribution June 24, 1990 4th Berkeley Distribution |