]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/nss-mymachines.xml
man,factory: update factory config for nsswitch.conf to match the man pages
[thirdparty/systemd.git] / man / nss-mymachines.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
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 SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="nss-mymachines" conditional='ENABLE_NSS_MYMACHINES'>
10
11 <refentryinfo>
12 <title>nss-mymachines</title>
13 <productname>systemd</productname>
14 </refentryinfo>
15
16 <refmeta>
17 <refentrytitle>nss-mymachines</refentrytitle>
18 <manvolnum>8</manvolnum>
19 </refmeta>
20
21 <refnamediv>
22 <refname>nss-mymachines</refname>
23 <refname>libnss_mymachines.so.2</refname>
24 <refpurpose>Provide hostname resolution for local
25 container instances.</refpurpose>
26 </refnamediv>
27
28 <refsynopsisdiv>
29 <para><filename>libnss_mymachines.so.2</filename></para>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Description</title>
34
35 <para><command>nss-mymachines</command> is a plug-in module for the GNU Name Service Switch (NSS) functionality of
36 the GNU C Library (<command>glibc</command>), providing hostname resolution for the names of containers running
37 locally that are registered with
38 <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. The
39 container names are resolved to the IP addresses of the specific container, ordered by their scope. This
40 functionality only applies to containers using network namespacing.</para>
41
42 <para>The module also resolves user and group IDs used by containers to user and group names indicating the
43 container name, and back. This functionality only applies to containers using user namespacing.</para>
44
45 <para>To activate the NSS module, add <literal>mymachines</literal> to the lines starting with
46 <literal>hosts:</literal>, <literal>passwd:</literal> and <literal>group:</literal> in
47 <filename>/etc/nsswitch.conf</filename>.</para>
48
49 <para>It is recommended to place <literal>mymachines</literal> after the <literal>files</literal> or
50 <literal>compat</literal> entry of the <filename>/etc/nsswitch.conf</filename> lines to make sure that its mappings
51 are preferred over other resolvers such as DNS, but so that <filename>/etc/hosts</filename>,
52 <filename>/etc/passwd</filename> and <filename>/etc/group</filename> based mappings take precedence.</para>
53 </refsect1>
54
55 <refsect1>
56 <title>Example</title>
57
58 <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables
59 <command>nss-mymachines</command> correctly:</para>
60
61 <!-- synchronize with other nss-* man pages and factory/etc/nsswitch.conf -->
62 <programlisting>passwd: compat <command>mymachines</command> systemd
63 group: compat <command>mymachines</command> systemd
64 shadow: compat
65
66 hosts: files <command>mymachines</command> resolve [!UNAVAIL=return] dns myhostname
67 networks: files
68
69 protocols: db files
70 services: db files
71 ethers: db files
72 rpc: db files
73
74 netgroup: nis</programlisting>
75
76 </refsect1>
77
78 <refsect1>
79 <title>See Also</title>
80 <para>
81 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
82 <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
83 <citerefentry><refentrytitle>nss-systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
84 <citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
85 <citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
86 <citerefentry project='man-pages'><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
87 <citerefentry project='man-pages'><refentrytitle>getent</refentrytitle><manvolnum>1</manvolnum></citerefentry>
88 </para>
89 </refsect1>
90
91 </refentry>