| 1 |
'\" t |
| 2 |
.TH "NSS\-RESOLVE" "8" "" "systemd 261~rc3" "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 resolvable 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 |
.PP |
| 137 |
\fI$SYSTEMD_NSS_RESOLVE_INTERFACE\fR |
| 138 |
.RS 4 |
| 139 |
Takes an interface name or index as an argument\&. When specified, answers will only be obtained from name servers belonging to the specified interface\&. |
| 140 |
.sp |
| 141 |
Added in version 260\&. |
| 142 |
.RE |
| 143 |
.SH "EXAMPLE" |
| 144 |
.PP |
| 145 |
Here is an example |
| 146 |
/etc/nsswitch\&.conf |
| 147 |
file that enables |
| 148 |
\fBnss\-resolve\fR |
| 149 |
correctly: |
| 150 |
.sp |
| 151 |
.if n \{\ |
| 152 |
.RS 4 |
| 153 |
.\} |
| 154 |
.nf |
| 155 |
passwd: files systemd |
| 156 |
group: files [SUCCESS=merge] systemd |
| 157 |
shadow: files systemd |
| 158 |
gshadow: files systemd |
| 159 |
|
| 160 |
hosts: mymachines \fBresolve [!UNAVAIL=return]\fR files myhostname dns |
| 161 |
networks: files |
| 162 |
|
| 163 |
protocols: db files |
| 164 |
services: db files |
| 165 |
ethers: db files |
| 166 |
rpc: db files |
| 167 |
|
| 168 |
netgroup: nis |
| 169 |
.fi |
| 170 |
.if n \{\ |
| 171 |
.RE |
| 172 |
.\} |
| 173 |
.SH "SEE ALSO" |
| 174 |
.PP |
| 175 |
\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) |