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