configuration

/etc/nsswitch.conf — Name-service source selection

On glibc systems, NSS selects information sources for databases such as hosts, passwd and group. Sources are evaluated in configured order with result-dependent actions (for example [NOTFOUND=return]). Modules must exist; defaults and ordering vary by distribution and database. NSS identity lookup is distinct from PAM authentication. Changes may affect account lookup or network access; use a recoverable VM, preserve the previous file, and avoid changing production login policy in this exercise.

Formal Syntax & Structure

linux syntaxlinux
DATABASE: SOURCE [ACTION ...] [SOURCE ...]

Parameters & Attributes

NameTypeDescription
DATABASEfieldLookup database name
SOURCEfieldProvider such as files or dns
ACTIONfieldBracketed status/action override

Return Value

configuration or inspection

Configuration of name-service lookups, not credentials or authentication decisions.

Working Example

Example Snippetlinux
printf '%s\n' 'hosts: files dns' 'passwd: files' | awk '$1=="hosts:" {print $2, $3}'
Linux Reference