nss-resolve man page

nss-resolve, libnss_resolve.so.2 — Provide hostname resolution via systemd-resolved.service

Synopsis

libnss_resolve.so.2

Description

nss-resolve is a plug-in module for the GNU Name Service Switch (NSS) functionality of the GNU C Library (glibc) enabling it to resolve host names via the systemd-resolved(8) local network name resolution service. It replaces the nss-dns plug-in module that traditionally resolves hostnames via DNS.

To activate the NSS module, add "resolve" to the line starting with "hosts:" in /etc/nsswitch.conf.

It is recommended to place "resolve" early in /etc/nsswitch.conf' "hosts:" line (but after the "files" or "mymachines" entries), replacing the "dns" entry if it exists, to ensure DNS queries are always routed via systemd-resolved(8).

Note that nss-resolve will chain-load nss-dns if systemd-resolved.service is not running, ensuring that basic DNS resolution continues to work if the service is down.

Example

Here is an example /etc/nsswitch.conf file that enables nss-resolve correctly:

passwd:         compat mymachines
group:          compat mymachines
shadow:         compat

hosts:          files mymachines resolve myhostname
networks:       files

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

netgroup:       nis

See Also

systemd(1), systemd-resolved(8), nss-mymachines(8), nss-myhostname(8), nsswitch.conf(5)

Referenced By

nss-myhostname(8), nss-mymachines(8), systemd.directives(7), systemd.index(7), systemd-resolved.service(8).

libnss_resolve.so.2(8) is an alias of nss-resolve(8).

systemd 231 nss-resolve