]>
Commit | Line | Data |
---|---|---|
514094f9 | 1 | <?xml version='1.0'?> |
0d6868f9 LP |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
4 | ||
5 | <!-- | |
572eb058 | 6 | SPDX-License-Identifier: LGPL-2.1+ |
0d6868f9 LP |
7 | --> |
8 | ||
08540a95 | 9 | <refentry id="nss-resolve" conditional='ENABLE_NSS_RESOLVE'> |
0d6868f9 LP |
10 | |
11 | <refentryinfo> | |
12 | <title>nss-resolve</title> | |
13 | <productname>systemd</productname> | |
0d6868f9 LP |
14 | </refentryinfo> |
15 | ||
16 | <refmeta> | |
17 | <refentrytitle>nss-resolve</refentrytitle> | |
18 | <manvolnum>8</manvolnum> | |
19 | </refmeta> | |
20 | ||
21 | <refnamediv> | |
22 | <refname>nss-resolve</refname> | |
23 | <refname>libnss_resolve.so.2</refname> | |
24 | <refpurpose>Provide hostname resolution via <filename>systemd-resolved.service</filename></refpurpose> | |
25 | </refnamediv> | |
26 | ||
27 | <refsynopsisdiv> | |
28 | <para><filename>libnss_resolve.so.2</filename></para> | |
29 | </refsynopsisdiv> | |
30 | ||
31 | <refsect1> | |
32 | <title>Description</title> | |
33 | ||
9053aaad LP |
34 | <para><command>nss-resolve</command> is a plug-in module for the GNU Name Service Switch (NSS) functionality of the |
35 | GNU C Library (<command>glibc</command>) enabling it to resolve host names via the | |
36 | <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry> local network | |
37 | name resolution service. It replaces the <command>nss-dns</command> plug-in module that traditionally resolves | |
38 | hostnames via DNS.</para> | |
39 | ||
40 | <para>To activate the NSS module, add <literal>resolve</literal> to the line starting with | |
2b015ea4 ZJS |
41 | <literal>hosts:</literal> in <filename>/etc/nsswitch.conf</filename>. Specifically, it is recommended to place |
42 | <literal>resolve</literal> early in <filename>/etc/nsswitch.conf</filename>'s <literal>hosts:</literal> line (but | |
640be880 LP |
43 | after the <literal>files</literal> or <literal>mymachines</literal> entries), right before the |
44 | <literal>dns</literal> entry if it exists, followed by <literal>[!UNAVAIL=return]</literal>, to ensure DNS queries | |
45 | are always routed via | |
46 | <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry> if it is | |
47 | running, but are routed to <command>nss-dns</command> if this service is not available.</para> | |
2b015ea4 ZJS |
48 | |
49 | <para>Note that <command>systemd-resolved</command> will synthesize DNS resource | |
25fb19da | 50 | records in a few cases, for example for <literal>localhost</literal> and the |
2b015ea4 ZJS |
51 | current hostname, see |
52 | <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
53 | for the full list. This duplicates the functionality of | |
54 | <citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
55 | but it is still recommended (see examples below) to keep | |
56 | <command>nss-myhostname</command> configured in | |
57 | <filename>/etc/nsswitch.conf</filename>, to keep those names resolveable if | |
58 | <command>systemd-resolved</command> is not running.</para> | |
0d6868f9 LP |
59 | </refsect1> |
60 | ||
61 | <refsect1> | |
62 | <title>Example</title> | |
63 | ||
9053aaad LP |
64 | <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables <command>nss-resolve</command> |
65 | correctly:</para> | |
0d6868f9 | 66 | |
94f760ec | 67 | <!-- synchronize with other nss-* man pages and factory/etc/nsswitch.conf --> |
409093fe LP |
68 | <programlisting>passwd: compat mymachines systemd |
69 | group: compat mymachines systemd | |
0d6868f9 LP |
70 | shadow: compat |
71 | ||
75555c28 | 72 | hosts: files mymachines <command>resolve [!UNAVAIL=return]</command> dns myhostname |
0d6868f9 LP |
73 | networks: files |
74 | ||
75 | protocols: db files | |
76 | services: db files | |
77 | ethers: db files | |
78 | rpc: db files | |
79 | ||
80 | netgroup: nis</programlisting> | |
0d6868f9 LP |
81 | </refsect1> |
82 | ||
83 | <refsect1> | |
84 | <title>See Also</title> | |
85 | <para> | |
86 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
87 | <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
409093fe | 88 | <citerefentry><refentrytitle>nss-systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
0d6868f9 | 89 | <citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
409093fe | 90 | <citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
0d6868f9 LP |
91 | <citerefentry project='man-pages'><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
92 | </para> | |
93 | </refsect1> | |
94 | ||
95 | </refentry> |