NSLOOKUP(8) BSD System Manager's Manual NSLOOKUP(8) NNAAMMEE nnssllooookkuupp - query Internet name servers interactively SSYYNNOOPPSSIISS nnssllooookkuupp [--ooppttiioonn _._._.] [_h_o_s_t_-_t_o_-_f_i_n_d | --[_s_e_r_v_e_r]] DDEESSCCRRIIPPTTIIOONN NNssllooookkuupp is a program to query Internet domain name servers. NNssllooookkuupp 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 do- main. AARRGGUUMMEENNTTSS Interactive mode is entered in the following cases: a) when no arguments are given (the default name server will be used), 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 _._n_s_l_o_o_k_u_p_r_c 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 pre- cede the arguments and are prefixed with a hyphen. For example, to change the default query type to host information, and the initial time- out to 10 seconds, type: nslookup -query=hinfo -timeout=10 IINNTTEERRAACCTTIIVVEE CCOOMMMMAANNDDSS 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 (.& .) NN..BB..:: unrecognized command will be interpreted as a N.B.:0 0N.B.:1 _h_o_s_t [_s_e_r_v_e_r] Look up information for _h_o_s_t using the current default server or using _s_e_r_v_e_r, if specified. If _h_o_s_t is an Internet address and the query type is A or PTR, the name of the host is returned. If _h_o_s_t is a name and does not have a trailing period, the de- fault domain name is appended to the name. (This behavior de- pends on the state of the sseett options ddoommaaiinn, ssrrcchhlliisstt, ddeeffnnaammee, and sseeaarrcchh.) To look up a host not in the current domain, append a period to the name. sseerrvveerr _d_o_m_a_i_n llsseerrvveerr _d_o_m_a_i_n Change the default server to _d_o_m_a_i_n; llsseerrvveerr uses the initial server to look up information about _d_o_m_a_i_n, while sseerrvveerr uses the current default server. If an authoritative answer can't be found, the names of servers that might have the answer are re- turned. rroooott Changes the default server to the server for the root of the do- main name space. Currently, the host ns.internic.net is used. (This command is a synonym for ``llsseerrvveerr nnss..iinntteerrnniicc..nneett''.) The name of the root server can be changed with the ``sseett rroooott'' command. ffiinnggeerr [_n_a_m_e] [>> _f_i_l_e_n_a_m_e] ffiinnggeerr [_n_a_m_e] [>>>> _f_i_l_e_n_a_m_e] Connects with the finger server on the current host. The cur- rent host is defined when a previous lookup for a host was suc- cessful and returned address information (see the ``sseett qquueerryyttyyppee==AA'' command). The _n_a_m_e is optional. >> and >>>> can be used to redirect output in the usual manner. llss [_o_p_t_i_o_n] _d_o_m_a_i_n [>> _f_i_l_e_n_a_m_e] llss [_o_p_t_i_o_n] _d_o_m_a_i_n [>>>> _f_i_l_e_n_a_m_e] List the information available for _d_o_m_a_i_n, optionally creating or appending to _f_i_l_e_n_a_m_e. The default output contains host names and their Internet addresses. _O_p_t_i_o_n can be one of the follow- ing: --tt _q_u_e_r_y_t_y_p_e lists all records of the specified type (see _q_u_e_r_y_t_y_p_e be- low). --aa lists aliases of hosts in the domain; synonym for ``--tt CNAME''. --dd lists all records for the domain; synonym for ``--tt ANY''. --hh lists CPU and operating system information for the domain; synonym for ``--tt HINFO''. --ss lists well-known services of hosts in the domain; synonym for ``--tt WKS''. When output is directed to a file, hash marks are printed for every 50 records received from the server. vviieeww _f_i_l_e_n_a_m_e Sorts and lists the output of previous llss command(s) with more(1). hheellpp ?? Prints a brief summary of commands. eexxiitt Exits the program. sseett _k_e_y_w_o_r_d [=_v_a_l_u_e] This command is used to change state information that affects the lookups. Valid keywords are: aallll Prints the current values of the frequently-used op- tions to sseett. Information about the current default server and host is also printed. ccllaassss==_v_a_l_u_e Change the query class to one of: 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 informa- tion. (Default = IN; abbreviation = ccll) [nnoo] ddeebbuugg Turn debugging mode on. A lot more information is printed about the packet sent to the server and the re- sulting answer. (Default = nnooddeebbuugg; abbreviation = [nnoo]ddeebb) [nnoo] dd22 Turn exhaustive debugging mode on. Essentially all fields of every packet are printed. (Default = nnoodd22) ddoommaaiinn==_n_a_m_e Change the default domain name to _n_a_m_e. The default do- main name is appended to a lookup request depending on the state of the ddeeffnnaammee and sseeaarrcchh options. The do- main search list contains the parents of the default domain if it has at least two components in its name. For example, if the default domain is CC.Berkeley.EDU, the search list is CC.Berkeley.EDU and Berkeley.EDU. Use the ``sseett ssrrcchhlliisstt'' command to specify a different list. Use the ``sseett aallll'' command to display the list. (Default = value from hostname(1), _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f, or LOCALDOMAIN; abbreviation = ddoo) ssrrcchhlliisstt==_n_a_m_e_1_/_n_a_m_e_2_/_._._. Change the default domain name to _n_a_m_e_1 and the domain search list to _n_a_m_e_1, _n_a_m_e_2, etc. A maximum of 6 names separated by slashes (/) can be specified. For exam- ple, 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 ``sseett ddoommaaiinn'' com- mand. Use the ``sseett aallll'' command to display the list. (Default = value based on hostname(1), _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f, or LOCALDOMAIN; abbreviation = ssrrcchhll) [nnoo] ddeeffnnaammee If set, append the default domain name to a single-com- ponent lookup request (i.e., one that does not contain a period). (Default = ddeeffnnaammee; abbreviation = [nnoo]ddeeffnnaammee) [nnoo] sseeaarrcchh If the lookup request contains at least one period but _d_o_e_s_n_'_t end with a trailing period, append the domain names in the domain search list to the request until an answer is received. (Default = sseeaarrcchh; abbreviation = [nnoo]sseeaa) ppoorrtt==_v_a_l_u_e Change the default TCP/UDP name server port to _v_a_l_u_e. (Default = 53; abbreviation = ppoo) qquueerryyttyyppee==_v_a_l_u_e ttyyppee==_v_a_l_u_e Change the type of information query to one of: 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 ad- dress; otherwise, the pointer to other infor- mation. SOA the domain's ``start-of-authority'' informa- tion. 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 = qq, ttyy) [nnoo] rreeccuurrssee Tell the name server to query other servers if it does not have the information. (Default = rreeccuurrssee; abbreviation = [nnoo]rreecc) rreettrryy==_n_u_m_b_e_r Set the number of retries to _n_u_m_b_e_r. When a reply to a request is not received within a certain amount of time (changed with ``sseett ttiimmeeoouutt''), the timeout period is doubled and the request is resent. The retry value controls how many times a request is resent before giv- ing up. (Default = 4, abbreviation = rreett) rroooott==_h_o_s_t Change the name of the root server to _h_o_s_t. This af- fects the ``rroooott'' command. (Default = nnss..iinntteerrnniicc..nneett..; abbreviation = rroo) ttiimmeeoouutt==_n_u_m_b_e_r Change the initial timeout interval for waiting for a reply to _n_u_m_b_e_r seconds. Each retry doubles the timeout period. (Default = 5 seconds; abbreviation = ttii) [nnoo] vvcc Always use a virtual circuit when sending requests to the server. (Default = nnoovvcc; abbreviation = [nnoo]vv) [nnoo] iiggnnoorreettcc Ignore packet truncation errors. (Default = nnooiiggnnoorreettcc; abbreviation = [nnoo]iigg) DDIIAAGGNNOOSSTTIICCSS 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 ``sseett ttiimmeeoouutt==_v_a_l_u_e'') and a certain number of retries (changed with ``sseett rreettrryy==_v_a_l_u_e''). No response from server No name server is running on the server machine. No records The server does not have resource records of the current query type for the host, although the host name is valid. The query type is specified with the ``sseett qquueerryyttyyppee'' command. Non-existent domain The host or domain name does not exist. Connection refused Network is unreachable The connection to the name or finger server could not be made at the current time. This error commonly occurs with llss and ffiinnggeerr requests. Server failure The name server found an internal inconsistency in its database and could not return a valid answer. Refused The name server refused to service the request. Format error The name server found that the request packet was not in the prop- er format. It may indicate an error in nnssllooookkuupp. FFIILLEESS /etc/resolv.conf initial domain name and name server ad- dresses $HOME/.nslookuprc user's initial options /usr/share/misc/nslookup.help summary of commands EENNVVIIRROONNMMEENNTT HOSTALIASES file containing host aliases LOCALDOMAIN overrides default domain SSEEEE AALLSSOO named(8), resolver(3), resolver(5); RFC-1034, ``Domain Names - Concepts and Facilities''; RFC-1035, ``Domain Names - Implementation and Specification''. AAUUTTHHOORR Andrew Cherenson 4th Berkeley Distribution June 24, 1990 6