Differences between revisions 3 and 4
Revision 3 as of 2022-09-24 01:33:37
Size: 2036
Comment:
Revision 4 as of 2023-06-22 20:14:43
Size: 2082
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from Linux/nsswitch.conf

nsswitch.conf

A description of the Name Service Switch (NSS) file (/etc/nsswitch.conf). For more details, see nsswitch.conf(5).


Example

passwd:         compat
group:          compat
shadow:         compat
hosts:          dns [!UNAVAIL=return] files
networks:       nis [NOTFOUND=return] files
ethers:         nis [NOTFOUND=return] files
protocols:      nis [NOTFOUND=return] files
rpc:            nis [NOTFOUND=return] files
services:       nis [NOTFOUND=return] files


Syntax

Databases

The first column (delimited by spaces or tab characters) indicates a database, while every subsequent column is a service specification or optional action.

Service Specifications

Common service specifications are:

  • files (i.e. /etc/hosts)

  • dns (i.e. runtime lookups based on /etc/resolv.conf)

  • myhostname (see nss-myhostname(8))

  • mymachine which connects to systemd-machined (see nss-mymachines(8))

  • resolve which connects to systemd-resolved (see nss-resolve(8))

Optional Actions

Option actions follow the pattern of [STATUS=ACTION] and [!STATUS=ACTION].

A status can be any of:

  • success meaning 'no error'.

  • notfound meaning 'error in lookup'.

  • unavail indicates a connection couldn't be made.

  • tryagain indicates 'temporarily unavailability', as with locked connections.

An action can be any of:

  • return meaning 'return the result'

  • continue meaning 'try the next item'

  • merge causes the system to try both the preceding and the following items

By default, only a success status results in a return action. Anything else will result in a continue. The exception the group database, where a notfound status will lead to a continue action regardless of any action specified.


CategoryRicottone

Linux/NsSwitchConf (last edited 2025-12-19 21:32:56 by DominicRicottone)