My nsswitch file contains the following

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

What is the meaning of the db value? For example in the protocols section I see db I assume this means so sort of database but where is this db? and is it just a plain text config file. If it is just a config file why wouldn't it just be files? And if it is a DB how do I edit it.

1 Answer 1


db causes libnss_db to be used. That reads data from Berkeley DB files usually stored in /var/db (/var/lib/misc on Debian); this is typically faster than reading from plain text files, for large NSS databases.

You should be able to modify the databases with a Berkeley DB client, but they’re typically built wholesale from the relevant source data. In the configuration above, the data sources are text files in /etc, and these remain the reference; the DB file is a variant used for speed, built wholesale using makedb, and not intended as the primary storage. The text files here are /etc/protocols for protocols, /etc/services for services, /etc/ethers for Ethernet addresses, /etc/rpc for RPC program numbers.

It’s more common to see db used for the passwd and group databases, as a local cache for large, remotely-hosted user databases (typically using LDAP).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.