NsSwitch.Conf

The Name Service Switch configuration file (or nsswitch.conf(5)), typically found at /etc/nsswitch.conf, declares how domain names should be translated into IP addresses.


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:

Optional Actions

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

A status can be any of:

An action can be any of:

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.


See also

nsswitch.conf(5)


CategoryRicottone

Linux/NsSwitchConf (last edited 2023-06-22 20:20:32 by DominicRicottone)