Name Service Switch
This article includes a improve this article by introducing more precise citations. (October 2022) ) |
The Name Service Switch (NSS) is an interface of
nsswitch.conf
A
The nsswitch.conf file has line entries for each service consisting of a database name in the first field, terminated by a colon, and a list of possible source databases in the second field.
A typical file might look like:
passwd: files ldap shadow: files group: files ldap hosts: dns nis files ethers: files nis netmasks: files nis networks: files nis protocols: files nis rpc: files nis services: files nis automount: files aliases: files
The order of the source databases determines the order the NSS will attempt to look up those sources to resolve queries for the specified service. A bracketed list of criteria may be specified following each source name to govern the conditions under which the NSS will proceed to querying the next source based on the preceding source's response.
History
Earlier Unix-like systems either accessed only local files or had hard-coded rules for accessing files or network-stored databases. Ultrix was a notable exception with its nearly identical functionality of the NSS configuration file in /etc/svc.conf.
Solaris' compliance with SVR4, which Sun Microsystems and
Sun engineers Thomas Maslen and Sanjay Dani were the first to design and implement the Name Service Switch. They fulfilled Solaris requirements with the nsswitch.conf file specification and the implementation choice to load database access modules as dynamically loaded libraries, which Sun was also the first to introduce.
Sun engineers' original design of the configuration file and runtime loading of name service back-end libraries has withstood the test of time as operating systems have evolved and new name services are introduced. Over the years, programmers ported the NSS configuration file with nearly identical implementations to many other operating systems including
See also
- BSD Authentication
- Group (database)
- Name server
- Pluggable Authentication Modules
References
- ^ "Name Service Switch (The GNU C Library)". www.gnu.org. Retrieved 2024-03-13.
External links
- NetBSD File Formats Manual : name-service switch configuration file –
- Name Service Switch implementation in the GNU C Library
- Another NSS module supporting LDAP: nss-ldapd
- NSS module supporting AFS: nss_afs