nslookup.1 (2010 09)
n
nslookup(1) nslookup(1)
(BIND 9.3)
NAME
nslookup - query name servers interactively
SYNOPSIS
Single Host Mode
nslookup [-swdebug][-setoption]... host [server ]
Interactive Mode
nslookup [-swdebug][-setoption]... [
- [server ]]
DESCRIPTION
The
nslookup program queries Internet domain name servers. It follows the configured name resolu-
tion algorithm of the host and queries NIS, DNS, and host tables.
In Single Host Mode (noninteractive),
nslookup queries a name server for information about one host
or domain. This mode occurs when you specify a host in the command.
In Interactive Mode,
nslookup lets you make several requests in the same session. For example, you
can query a name server for information about various hosts and domains or print a list of hosts in the
domain. This mode occurs when you omit the host (and server ) in the command or when you use the spe-
cial
- placeholder.
Options
-setoption
Set the setoption , as defined for the set command. See The set Command subsection in the
INTERACTIVE COMMANDS section.
-swdebug
Turn on tracing during command initialization, causing the switch module to print out a trace
of the scan and parse actions on the hosts database entry in the /etc/nsswitch.conf
file (see nsswitch.conf(4)). It may be used to debug syntactic errors in the switch configuration
file. See also the
set option [no]trace.
Note:
swdebug is not a set command option, so you cannot turn it off in interactive mode.
Operands
host The host name or IP address of a host system. If host is present, the command is executed
immediately (noninteractively). If it is omitted,
nslookup enters interactive mode.
- Set interactive mode. This placeholder is needed if you specify server for interactive mode.
server The host name or IP address of a domain name server. If omitted,
nslookup uses the policy
described in the Default Lookup Policy subsection.
Initialization File
The setoption s and
swdebug (see the Options subsection) can be specified in a .nslookuprc startup
file in the user’s home directory. Enter them one per line without the leading hyphen (-).
Default Lookup Policy
If a server has not been specified explicitly to override the switch policy,
nslookup initializes each of the
name services in the hosts database in the switch configuration file /etc/nsswitch.conf (see
nsswitch.conf(4)), but uses the first name service for lookup. The initialization of the name services may
cause a delay in obtaining the response if any of the name services is not responding. For example, con-
sider when the
hosts database is defined with the following name services:
hosts : files dns nis
If the name servers mentioned in /etc/resolv.conf (see resolver (4)) are unavailable, there will be a
delay in trying to initialize the name servers. The handling of the query thereafter follows the switch pol-
icy, as would be expected.
nslookup contacts the name servers mentioned in /etc/resolv.conf sequentially but does not
cycle through them like the resolver routines do (see resolver (3N)).
Note:
nslookup should not be used as a command-line substitute for the resolver routines unless the
differences in resolution behavior between nslookup and the resolver routines are understood and are
acceptable for the scripting environment where nslookup will be employed.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1