]>
Commit | Line | Data |
---|---|---|
dbda6dce LP |
1 | <?xml version='1.0'?> <!--*-nxml-*--> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
dbda6dce LP |
4 | |
5 | <!-- | |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2014 Lennart Poettering | |
9 | ||
10 | systemd is free software; you can redistribute it and/or modify it | |
11 | under the terms of the GNU Lesser General Public License as published by | |
12 | the Free Software Foundation; either version 2.1 of the License, or | |
13 | (at your option) any later version. | |
14 | ||
15 | systemd is distributed in the hope that it will be useful, but | |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | Lesser General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU Lesser General Public License | |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
22 | --> | |
23 | ||
24 | <refentry id="nss-mymachines" conditional='ENABLE_MACHINED'> | |
25 | ||
798d3a52 ZJS |
26 | <refentryinfo> |
27 | <title>nss-mymachines</title> | |
28 | <productname>systemd</productname> | |
29 | ||
30 | <authorgroup> | |
31 | <author> | |
32 | <contrib>Developer</contrib> | |
33 | <firstname>Lennart</firstname> | |
34 | <surname>Poettering</surname> | |
35 | <email>lennart@poettering.net</email> | |
36 | </author> | |
37 | </authorgroup> | |
38 | </refentryinfo> | |
39 | ||
40 | <refmeta> | |
41 | <refentrytitle>nss-mymachines</refentrytitle> | |
42 | <manvolnum>8</manvolnum> | |
43 | </refmeta> | |
44 | ||
45 | <refnamediv> | |
46 | <refname>nss-mymachines</refname> | |
47 | <refname>libnss_mymachines.so.2</refname> | |
48 | <refpurpose>Provide hostname resolution for local | |
49 | container instances.</refpurpose> | |
50 | </refnamediv> | |
51 | ||
52 | <refsynopsisdiv> | |
53 | <para><filename>libnss_mymachines.so.2</filename></para> | |
54 | </refsynopsisdiv> | |
55 | ||
56 | <refsect1> | |
57 | <title>Description</title> | |
58 | ||
9053aaad LP |
59 | <para><command>nss-mymachines</command> is a plug-in module for the GNU Name Service Switch (NSS) functionality of |
60 | the GNU C Library (<command>glibc</command>), providing hostname resolution for the names of containers running | |
61 | locally that are registered with | |
62 | <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. The | |
63 | container names are resolved to the IP addresses of the specific container, ordered by their scope. This | |
64 | functionality only applies to containers using network namespacing.</para> | |
65 | ||
66 | <para>The module also resolves user and group IDs used by containers to user and group names indicating the | |
67 | container name, and back. This functionality only applies to containers using user namespacing.</para> | |
68 | ||
69 | <para>To activate the NSS module, add <literal>mymachines</literal> to the lines starting with | |
70 | <literal>hosts:</literal>, <literal>passwd:</literal> and <literal>group:</literal> in | |
798d3a52 ZJS |
71 | <filename>/etc/nsswitch.conf</filename>.</para> |
72 | ||
9053aaad LP |
73 | <para>It is recommended to place <literal>mymachines</literal> after the <literal>files</literal> or |
74 | <literal>compat</literal> entry of the <filename>/etc/nsswitch.conf</filename> lines to make sure that its mappings | |
75 | are preferred over other resolvers such as DNS, but so that <filename>/etc/hosts</filename>, | |
76 | <filename>/etc/passwd</filename> and <filename>/etc/group</filename> based mappings take precedence.</para> | |
798d3a52 ZJS |
77 | </refsect1> |
78 | ||
79 | <refsect1> | |
80 | <title>Example</title> | |
81 | ||
9053aaad LP |
82 | <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables |
83 | <command>nss-mymachines</command> correctly:</para> | |
798d3a52 | 84 | |
409093fe LP |
85 | <programlisting>passwd: compat <command>mymachines</command> systemd |
86 | group: compat <command>mymachines</command> systemd | |
c01ff965 | 87 | shadow: compat |
798d3a52 | 88 | |
75555c28 | 89 | hosts: files <command>mymachines</command> resolve [!UNAVAIL=return] dns myhostname |
dbda6dce LP |
90 | networks: files |
91 | ||
92 | protocols: db files | |
93 | services: db files | |
c01ff965 LP |
94 | ethers: db files |
95 | rpc: db files | |
dbda6dce LP |
96 | |
97 | netgroup: nis</programlisting> | |
98 | ||
798d3a52 ZJS |
99 | </refsect1> |
100 | ||
101 | <refsect1> | |
102 | <title>See Also</title> | |
103 | <para> | |
104 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
105 | <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
409093fe | 106 | <citerefentry><refentrytitle>nss-systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
0d6868f9 | 107 | <citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
798d3a52 ZJS |
108 | <citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
109 | <citerefentry project='man-pages'><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
110 | <citerefentry project='man-pages'><refentrytitle>getent</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
111 | </para> | |
112 | </refsect1> | |
dbda6dce LP |
113 | |
114 | </refentry> |