]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/nss-resolve.xml
core: enforce user/group name validity also when creating transient units
[thirdparty/systemd.git] / man / nss-resolve.xml
CommitLineData
0d6868f9
LP
1<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
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<!--
6 This file is part of systemd.
7
8 Copyright 2011 Lennart Poettering
9 Copyright 2013 Tom Gundersen
10
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
15
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
20
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23-->
24
25<refentry id="nss-resolve" conditional='ENABLE_RESOLVED'>
26
27 <refentryinfo>
28 <title>nss-resolve</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>nss-resolve</refentrytitle>
43 <manvolnum>8</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>nss-resolve</refname>
48 <refname>libnss_resolve.so.2</refname>
49 <refpurpose>Provide hostname resolution via <filename>systemd-resolved.service</filename></refpurpose>
50 </refnamediv>
51
52 <refsynopsisdiv>
53 <para><filename>libnss_resolve.so.2</filename></para>
54 </refsynopsisdiv>
55
56 <refsect1>
57 <title>Description</title>
58
9053aaad
LP
59 <para><command>nss-resolve</command> is a plug-in module for the GNU Name Service Switch (NSS) functionality of the
60 GNU C Library (<command>glibc</command>) enabling it to resolve host names via the
61 <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry> local network
62 name resolution service. It replaces the <command>nss-dns</command> plug-in module that traditionally resolves
63 hostnames via DNS.</para>
64
65 <para>To activate the NSS module, add <literal>resolve</literal> to the line starting with
66 <literal>hosts:</literal> in <filename>/etc/nsswitch.conf</filename>.</para>
67
68 <para>It is recommended to place <literal>resolve</literal> early in <filename>/etc/nsswitch.conf</filename>'
69 <literal>hosts:</literal> line (but after the <literal>files</literal> or <literal>mymachines</literal> entries),
70 replacing the <literal>dns</literal> entry if it exists, to ensure DNS queries are always routed via
0d6868f9 71 <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
9053aaad
LP
72
73 <para>Note that <command>nss-resolve</command> will chain-load <command>nss-dns</command> if
74 <filename>systemd-resolved.service</filename> is not running, ensuring that basic DNS resolution continues to work
75 if the service is down.</para>
0d6868f9
LP
76 </refsect1>
77
78 <refsect1>
79 <title>Example</title>
80
9053aaad
LP
81 <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables <command>nss-resolve</command>
82 correctly:</para>
0d6868f9 83
a8ba86ce
LP
84<programlisting>passwd: compat mymachines
85group: compat mymachines
0d6868f9
LP
86shadow: compat
87
9053aaad 88hosts: files mymachines <command>resolve</command> myhostname
0d6868f9
LP
89networks: files
90
91protocols: db files
92services: db files
93ethers: db files
94rpc: db files
95
96netgroup: nis</programlisting>
97
0d6868f9
LP
98 </refsect1>
99
100 <refsect1>
101 <title>See Also</title>
102 <para>
103 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
104 <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
105 <citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
106 <citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
107 <citerefentry project='man-pages'><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
108 </para>
109 </refsect1>
110
111</refentry>