HP-UX Reference (11i v1 00/12) - 4 File Formats (vol 8)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man4/!!!intro.4
________________________________________________________________
___ ___
n
nsswitch.conf(4) nsswitch.conf(4)
NAME
nsswitch.conf - configuration file for the name-service switch
SYNOPSIS
/etc/nsswitch.conf
DESCRIPTION
The operating system uses a number of "databases" of information about hosts, users (passwd), groups
and so forth. Data for these can come from a variety of sources: host-names and -addresses, for example,
may be found in /etc/hosts, NIS, NIS+ or DNS. One or more sources may be used for each database;
the sources and their lookup order are specified in the /etc/nsswitch.conf file.
The following databases use the switch:
Database Used by
aliases sendmail
automount automount
group getgrnam()
hosts gethostbyname()
netgroup innetgr()
networks getnetbyname()
passwd getpwnam()
, getspnam()
protocols getprotobyname()
publickey getpublickey()
, secure_rpc()
rpc getrpcbyname()
sendmailvars sendmail
services getservbyname()
The following sources may be used:
Source Uses
files /etc/hosts, /etc/passwd , and so forth
nis NIS (YP)
nisplus NIS+
dns Valid only for hosts; uses the Internet Domain Name Service.
compat Valid only for passwd and group; implements "+" and "-".
(See "Interaction with +/- syntax" below)
There is an entry in /etc/nsswitch.conf
for each database. Typically these entries will be simple,
like "protocols: files" or "networks: files nisplus". However, when multiple sources are specified it is some-
times necessary to define precisely the circumstances under which each source will be tried. A source can
return one of the following codes:
Status Meaning
SUCCESS Requested database entry was found
UNAVAIL Source is not responding or corrupted
NOTFOUND Source responded "no such entry"
TRYAGAIN Source is busy, might respond to retries
For each status code, two actions are possible:
Action Meaning
continue Try the next source in the list
return Return now
The complete syntax of an entry is
<entry> ::= <database> ":" [<source> [<criteria>]]* <source>
<criteria> ::= "[" <criterion>+ "]"
<criterion> ::= <status> "=" <action>
<status> ::= "success" | "notfound" | "unavail" | "tryagain"
<action> ::= "return" | "continue"
Each entry occupies a single line in the file. Lines that are blank, or that start with white space character
are ignored. Everything on a line following a # character is also ignored; the # character can begin any-
where in a line, to be used to begin comments. The <database> and <source> names are case-sensitive, but
<action> and <status> names are case-insensitive.
HP-UX Release 11i: December 2000 1 Section 4191
___
___