file specifies how the
(name-service switch dispatcher) routines in the C library should operate.
The configuration file controls how a process looks up various databases
containing information regarding hosts, users (passwords), groups, etc.
Each database comes from a source (such as local files, DNS,
and cache), and the order to look up the sources is specified in
Each entry in
consists of a database name, and a space separated list of sources.
Each source can have an optional trailing criterion that determines
whether the next listed source is used, or the search terminates at
the current source.
Each criterion consists of one or more status codes, and actions to
take if that status code occurs.
The following sources are implemented:
Local files, such as
Internet Domain Name System.
class entries, all other databases use
class (Hesiod) entries.
NIS (formerly YP)
If this is present, it must be the only source for that entry.
Each entry starts on a new line in the file.
delimits a comment to end of line.
Blank lines are ignored.
at the end of a line escapes the newline, and causes the next line to
be a continuation of the current line.
All entries are case-insensitive.
The default criteria is to return on
and continue on anything else (i.e,
[success=return notfound=continue unavail=continue tryagain=continue] )
You can enable caching for the particular database by specifying
as the first source in the
You should also enable caching for this database in
If for the particular query
source returns success, no further sources are queried.
On the other hand, if there are no previously cached data, the
query result will be placed into the cache right after
all other sources are processed.
daemon to be running.
Compat mode: +/- syntax
In historical multi-source implementations, the
characters are used to specify the importing of user password and
group information from
provides alternative methods of accessing distributed sources such as
specifying a sole source of
will provide the historical behaviour.
An alternative source for the information accessed via
can be used by specifying
in this case can be
any other source except for
Historically, many of the databases had enumeration functions, often of
These made sense when the databases were in local files, but do not make
sense or have lesser relevance when there are possibly multiple sources,
each of an unknown size.
The interfaces are still provided for compatibility, but the source
may not be able to provide complete entries, or duplicate entries may
be retrieved if multiple sources that contain similar information are
To ensure compatibility with previous and current implementations, the
source must appear alone for a given database.
Default source lists
If, for any reason,
does not exist, or it has missing or corrupt entries,
will default to an entry of
for the requested database.
Default source list
To lookup hosts in cache, then in
and then from the DNS, and lookup user information from
then files, use:
cache files dns
nis [notfound=return] files
nis [notfound=return] files
sets a policy of "if the user is notfound in nis, do not try files."
This treats nis as the authoritative source of information, except
when the server is down.
If system got compiled with
you have to remove
Fx Ns 's
provides stubs for compatibility with NSS modules
written for the
However, these stubs only support the use of the