Debian Codegraph @

upstream/debian-trixie/man8/nss-resolve.8

raw
1 '\" t
2 .TH "NSS\-RESOLVE" "8" "" "systemd 257.13" "nss-resolve"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 nss-resolve, libnss_resolve.so.2 \- Hostname resolution via systemd\-resolved\&.service
24 .SH "SYNOPSIS"
25 .PP
26 libnss_resolve\&.so\&.2
27 .SH "DESCRIPTION"
28 .PP
29 \fBnss\-resolve\fR
30 is a plug\-in module for the GNU Name Service Switch (NSS) functionality of the GNU C Library (\fBglibc\fR) enabling it to resolve hostnames via the
31 \fBsystemd-resolved\fR(8)
32 local network name resolution service\&. It replaces the
33 \fBnss\-dns\fR
34 plug\-in module that traditionally resolves hostnames via DNS\&.
35 .PP
36 To activate the NSS module, add
37 "resolve\ \&[!UNAVAIL=return]"
38 to the line starting with
39 "hosts:"
40 in
41 /etc/nsswitch\&.conf\&. Specifically, it is recommended to place
42 "resolve"
43 early in
44 /etc/nsswitch\&.conf\*(Aqs
45 "hosts:"
46 line\&. It should be before the
47 "files"
48 entry, since
49 systemd\-resolved
50 supports
51 /etc/hosts
52 internally, but with caching\&. To the contrary, it should be after
53 "mymachines", to give hostnames given to local VMs and containers precedence over names received over DNS\&. Finally, we recommend placing
54 "dns"
55 somewhere after
56 "resolve", to fall back to
57 \fBnss\-dns\fR
58 if
59 systemd\-resolved\&.service
60 is not available\&.
61 .PP
62 Note that
63 \fBsystemd\-resolved\fR
64 will synthesize DNS resource records in a few cases, for example for
65 "localhost"
66 and the current local hostname, see
67 \fBsystemd-resolved\fR(8)
68 for the full list\&. This duplicates the functionality of
69 \fBnss-myhostname\fR(8), but it is still recommended (see examples below) to keep
70 \fBnss\-myhostname\fR
71 configured in
72 /etc/nsswitch\&.conf, to keep those names resolveable if
73 \fBsystemd\-resolved\fR
74 is not running\&.
75 .PP
76 Please keep in mind that
77 \fBnss\-myhostname\fR
78 (and
79 \fBnss\-resolve\fR) also resolve in the other direction \(em from locally attached IP addresses to hostnames\&. If you rely on that lookup being provided by DNS, you might want to order things differently\&.
80 .PP
81 Communication between
82 \fBnss\-resolve\fR
83 and
84 systemd\-resolved\&.service
85 takes place via the
86 /run/systemd/resolve/io\&.systemd\&.Resolve
87 \fBAF_UNIX\fR
88 socket\&.
89 .SH "ENVIRONMENT VARIABLES"
90 .PP
91 \fI$SYSTEMD_NSS_RESOLVE_VALIDATE\fR
92 .RS 4
93 Takes a boolean argument\&. When false, cryptographic validation of resource records via DNSSEC will be disabled\&. This may be useful for testing, or when system time is known to be unreliable\&.
94 .sp
95 Added in version 250\&.
96 .RE
97 .PP
98 \fI$SYSTEMD_NSS_RESOLVE_SYNTHESIZE\fR
99 .RS 4
100 Takes a boolean argument\&. When false, synthetic records, e\&.g\&. for the local host name, will not be returned\&. See section SYNTHETIC RECORDS in
101 \fBsystemd-resolved.service\fR(8)
102 for more information\&. This may be useful to query the "public" resource records, independent of the configuration of the local machine\&.
103 .sp
104 Added in version 250\&.
105 .RE
106 .PP
107 \fI$SYSTEMD_NSS_RESOLVE_CACHE\fR
108 .RS 4
109 Takes a boolean argument\&. When false, the cache of previously queried records will not be used by
110 \fBsystemd-resolved\fR(8)\&.
111 .sp
112 Added in version 250\&.
113 .RE
114 .PP
115 \fI$SYSTEMD_NSS_RESOLVE_ZONE\fR
116 .RS 4
117 Takes a boolean argument\&. When false, answers using locally registered public LLMNR/mDNS resource records will not be returned\&.
118 .sp
119 Added in version 250\&.
120 .RE
121 .PP
122 \fI$SYSTEMD_NSS_RESOLVE_TRUST_ANCHOR\fR
123 .RS 4
124 Takes a boolean argument\&. When false, answers using locally configured trust anchors will not be used\&.
125 .sp
126 Added in version 250\&.
127 .RE
128 .PP
129 \fI$SYSTEMD_NSS_RESOLVE_NETWORK\fR
130 .RS 4
131 Takes a boolean argument\&. When false, answers will be returned without using the network, i\&.e\&. either from local sources or the cache in
132 \fBsystemd-resolved\fR(8)\&.
133 .sp
134 Added in version 250\&.
135 .RE
136 .SH "EXAMPLE"
137 .PP
138 Here is an example
139 /etc/nsswitch\&.conf
140 file that enables
141 \fBnss\-resolve\fR
142 correctly:
143 .sp
144 .if n \{\
145 .RS 4
146 .\}
147 .nf
148 passwd: files systemd
149 group: files [SUCCESS=merge] systemd
150 shadow: files systemd
151 gshadow: files systemd
152
153 hosts: mymachines \fBresolve [!UNAVAIL=return]\fR files myhostname dns
154 networks: files
155
156 protocols: db files
157 services: db files
158 ethers: db files
159 rpc: db files
160
161 netgroup: nis
162 .fi
163 .if n \{\
164 .RE
165 .\}
166 .SH "SEE ALSO"
167 .PP
168 \fBsystemd\fR(1), \fBsystemd-resolved\fR(8), \fBnss-systemd\fR(8), \fBnss-myhostname\fR(8), \fBnss-mymachines\fR(8), \fBnsswitch.conf\fR(5), \fBsystemd.syntax\fR(7)