nsswitch.conf.4 (2010 09)

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, LDAP, or DNS. One or more sources may be used for each data-
base; 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()
ipnodes getipnodebyname()
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)
ldap LDAP Directory Server
dns Valid only for hosts, ipnodes; 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 nis. However, when multiple sources are specified
it is sometimes 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 charac-
ter are ignored. Everything on a line following a
# character is also ignored; the # character can begin
anywhere in a line, to be used to begin comments. The database and source names are case-sensitive, but
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (4 pages)