Home

etcnsswitchconf

etcnsswitchconf refers to the configuration used by the Name Service Switch (NSS) on Unix-like systems, most commonly the file /etc/nsswitch.conf. This file instructs the system how to resolve various databases, such as user accounts, hostnames, and other networked resources, by defining the order and sources to consult.

The file consists of lines that pair a database name with an ordered list of sources. Each

Common databases configured in nsswitch.conf include passwd, group, and shadow for user information; hosts for hostname

Utilities such as getent query the NSS databases defined in this file. NSS caching daemons like nscd

line
follows
the
format:
database:
source1
source2
...
The
sources
indicate
where
to
look
for
information,
and
common
options
include
files
(for
local
files
like
/etc/passwd
and
/etc/group),
dns
(domain
name
system),
ldap
(Lightweight
Directory
Access
Protocol),
nis
(Network
Information
Service),
sss
(System
Security
Services
Daemon),
and
mdns
(multicast
DNS),
among
others.
The
syntax
also
supports
compatibility
and
conditional
behavior,
such
as
the
use
of
compat
for
legacy
/etc/passwd
and
/etc/group
formats
or
[NOTFOUND=return]
to
alter
lookup
flow
when
a
source
cannot
resolve
an
entry.
resolution;
and
services,
protocols,
networks,
and
ethers
for
related
network
data.
A
typical
line
might
read:
passwd:
files
ldap,
group:
files
ldap,
hosts:
files
dns
mdns4_minimal
[NOTFOUND=return]
dns.
On
some
systems
you
may
also
see
lines
using
sss
or
nis,
reflecting
local
deployment
choices
or
centralized
authentication.
or
sssd
may
cache
results
and
improve
performance
without
altering
the
configuration.
Editing
etcnsswitchconf
requires
appropriate
privileges
and
should
be
done
with
care,
as
misconfigurations
can
affect
system
authentication
and
name
resolution.