HP-UX Reference (11i v1 05/09) - 1 User Commands N-Z (vol 2)
n
nslookup(1) nslookup(1)
NAME
nslookup - query name servers interactively
SYNOPSIS
nslookup [-option ...] host-to-find [ server ]
nslookup [-option ...] [- [server ]]
DESCRIPTION
nslookup is a program to query Internet domain name servers.
nslookup has been extended to fol-
low the configured name resolution algorithm of the host and to query NIS, as well as, DNS and host
tables.
Both an interactive and non-interactive mode are available with
nslookup. Interactive mode allows the
user to query a name server for information about various hosts and domains, or print a list of hosts in the
domain. Non-interactive mode is used to query a name server for information about one host or domain.
By default,
nslookup accesses name services for name and address resolution based on the policy infor-
mation obtained from the switch configuration file
/etc/nsswitch.conf
. When the policy is set to use
NIS or
/etc/hosts first, or when DNS is first but unavailable, then nslookup will only provide a lim-
ited command set (a
help command while in this situation will show what actions are possible when
querying NIS or /etc/hosts). To override the switch policy and query DNS servers directly, the
server command can be used to specify a nameserver. This same overriding of the switch policy can also
be done by providing a nameserver as the second argument on the command line. In this case,
nslookup
will ignore the switch policy and directly query nameservers, until a reset command is issued. Whenever an
action is taken that causes the switch policy to be overridden, a warning message is displayed.
Note, NIS+ is not supported by nslookup. If the hosts source nisplus is found in the
/etc/nsswitch.conf
file. It will be ignored.
ARGUMENTS
Interactive mode is entered in the following cases:
• No arguments are given.
• The first argument is a hyphen (
-). The optional second argument is a host name or Internet (IP)
address of a name server.
Non-interactive mode is used when the name of the host to be looked up is given as the first argument.
The optional second argument is a host name or Internet address of a name server.
Options listed under the set command below can be specified one per line in the
.nslookuprc file in
the user’s home directory. Alternatively, these options may be specified on the command line by prefixing
them with a hyphen and they must precede other command line arguments. For example, to change the
default query type to host information, and the initial timeout to 10 seconds, type:
nslookup -query=hinfo -timeout=10
The command line option -swdebug may be used to debug syntactic errors in the switch configuration
file. This option turns on tracing during initialization, causing the switch module to print out a trace of the
scan and parse actions on the "hosts" entry (see nsswitch.conf(4)) in the /etc/nsswitch.conf
file.
Interactive Commands
Commands can be interrupted at any time by using the interrupt character. To exit, type a Ctrl-D (EOF)
or type
exit. To treat a built-in command as a host name, precede it with an escape character (\). When
using NIS or the host table, only host names and Internet addresses are allowed as commands. An
unrecognized command is 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, one or more domains are
appended to the name (this behavior depends on the state of the set options domain,
srchlist, defname, and search). Answers from a name server’s cache are labeled
‘‘non-authoritative.’’
server domain
lserver domain
Change the default server to domain. lserver uses the initial server to look up
HP-UX 11i Version 1: September 2005 − 1 − Hewlett-Packard Company Section 1−−659