Scroll to navigation

NSSWITCH-CONFIG(8) managing nsswitch.conf NSSWITCH-CONFIG(8)

NAME

nsswitch.conf -

SYNOPSIS

nsswitch-config [OPTIONS]

DESCRIPTION

Tool which merges different nsswitch configuration file snippets into one single nsswitch.conf file. This file is located in the /etc directory.

The program parses different configurations files with the order defined by the UAPI group: https://github.com/uapi-group/specifications/blob/main/specs/configuration_files_specification.md and combines the parsed values to one single file. Only drop-ins WITHOUT main configuration file will be merged: https://github.com/uapi-group/specifications/blob/main/specs/configuration_files_specification.md#drop-ins-without-main-configuration-file

Example

Files will be managed in following order:

* /usr/share/nsswitch.conf will not be regarded.
Will not be regarded.


Content:
# comment for /usr/share/nsswitch.conf
hosts: files

* /usr/share/nsswitch.conf.d/10-mdns.conf
Vendor defined snipped


Content:
# comment for /usr/share/nsswitch.conf.d/10-mdns.conf
hosts: mdns_minimal [NOTFOUND=return]

* /etc/nsswitch.conf.d/20-compat.conf
Admin defined snipped


Content:
# comment for /etc/nsswitch.conf.d/20-compat.conf
passwd: compat
group: compat
shadow: compat

* /usr/share/nsswitch.conf.d/30-dns.conf
Vendor defined snipped


Content:
# comment for /usr/share/nsswitch.conf.d/30-dns.conf
hosts: dns

* /etc/nsswitch.conf.d/40-dns.conf
Admin defined snipped


Content:
# comment for etc/nsswitch.conf.d/40-dns.conf (no double entry)
hosts: dns

Generates /etc/nsswitch.conf with following content:


# This file was generated by nsswitch-config. Do not edit it.
# Changes can be done with single snippets, stored in <etc_dir>/nsswitch.conf.d/<snipped_name>
# This file will not be overwritten if the comments above are removed.
#
# comment for /usr/share/nsswitch.conf.d/10-mdns.conf
# comment for /usr/share/nsswitch.conf.d/30-dns.conf
# comment for etc/nsswitch.conf.d/40-dns.conf (no double entry)
hosts:mdns_minimal [NOTFOUND=return] dns
# comment nr.1 for /etc/nsswitch.conf.d/20-compat.conf
# comment nr.2 for /etc/nsswitch.conf.d/20-compat.conf
passwd:compat
group:compat
shadow:compat

/etc/nsswitch.conf will be overwritten only, if it has not been created by the admin. Otherwise it will be kept untouched and the results will be written to /etc/nsswitch.conf.rpmnew.

general OPTIONS


Directory for vendor specific configuration files.
default: /usr/share


Directory for user changed configuration files (default: /etc).


Path of generated nsswitch.conf file (default: /etc/nsswitch.conf).


Generates additional information.


Overwite output file although it has been created by the admin.


Returns 0 if the output file has been generated by nsswitch-config.

SEE ALSO

nsswitch.conf(5)

23 Oct 2025 nsswitch-config