12.3. Option Settingsnslookup has its own set of dials and knobs, called option settings. All of the option settings can be changed. We'll discuss here what each of the options means, and we'll use the rest of the chapter to show you how to use them.
Before we get into the options, we need to cover the introductory lines. The default name server is bladerunner.fx.movie.edu. This means that nslookup will query bladerunner unless we specify another name server. The address 0.0.0.0 means "this host." When nslookup is using address 0.0.0.0 or 127.0.0.1 as its name server, it is using the server running on the local system -- in this case, bladerunner.% nslookup Default Server: bladerunner.fx.movie.edu Address: 0.0.0.0 > set all Default Server: bladerunner.fx.movie.edu Address: 0.0.0.0 Set options: nodebug defname search recurse nod2 novc noignoretc port=53 querytype=A class=IN timeout=5 retry=4 root=a.root-servers.net. domain=fx.movie.edu srchlist=fx.movie.edu > ^D
The options come in two flavors: Boolean and value. The options that do not have an equals sign after them are Boolean options. They have the interesting property of being either "on" or "off." The value options can take on different, well, values. How can we tell which Boolean options are on and which are off? The option is off when a "no" precedes the option's name. nodebug means that debugging is off. As you might guess, the searchoption is on.
How you change Boolean or value options depends on whether you are using nslookup interactively or not. In an interactive session, you change an option with the set command, as in set debug or set domain=classics.movie.edu. From the command line, you omit the word set and precede the option with a hyphen, as in nslookup -debug or nslookup -domain=classics.movie.edu. The options can be abbreviated to their shortest unique prefix, e.g., nodeb for nodebug. In addition to its abbreviation, the querytype option can also be called simply type.
Let's go through each of the options:
12.3.1. The .nslookuprc FileYou can set up new default nslookup options in an .nslookuprc file. nslookup looks for an .nslookuprc file in your home directory when it starts up, in both interactive and noninteractive modes. The .nslookuprc file can contain any legal set commands, one per line. This is useful, for example, if your old nslookup still thinks sri-nic.arpa is a root name server. You can set the default root name server to a real, current root with a line like this in your .nslookuprc file:
You might also use .nslookuprc to set your search list to something other than your host's default search list or to change the timeouts nslookup uses.set root=a.root-servers.net.
Copyright © 2002 O'Reilly & Associates. All rights reserved.