]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/nss-mymachines.xml
machinectl: fix printing of multiple addresses
[thirdparty/systemd.git] / man / nss-mymachines.xml
CommitLineData
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<!--
572eb058 6 SPDX-License-Identifier: LGPL-2.1+
dbda6dce
LP
7-->
8
08540a95 9<refentry id="nss-mymachines" conditional='ENABLE_NSS_MYMACHINES'>
dbda6dce 10
798d3a52
ZJS
11 <refentryinfo>
12 <title>nss-mymachines</title>
13 <productname>systemd</productname>
798d3a52
ZJS
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
9053aaad
LP
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
798d3a52
ZJS
47 <filename>/etc/nsswitch.conf</filename>.</para>
48
9053aaad
LP
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>
798d3a52
ZJS
53 </refsect1>
54
55 <refsect1>
56 <title>Example</title>
57
9053aaad
LP
58 <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables
59 <command>nss-mymachines</command> correctly:</para>
798d3a52 60
94f760ec 61 <!-- synchronize with other nss-* man pages and factory/etc/nsswitch.conf -->
409093fe
LP
62 <programlisting>passwd: compat <command>mymachines</command> systemd
63group: compat <command>mymachines</command> systemd
c01ff965 64shadow: compat
798d3a52 65
75555c28 66hosts: files <command>mymachines</command> resolve [!UNAVAIL=return] dns myhostname
dbda6dce
LP
67networks: files
68
69protocols: db files
70services: db files
c01ff965
LP
71ethers: db files
72rpc: db files
dbda6dce
LP
73
74netgroup: nis</programlisting>
75
798d3a52
ZJS
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>,
409093fe 83 <citerefentry><refentrytitle>nss-systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
0d6868f9 84 <citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
798d3a52
ZJS
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>
dbda6dce
LP
90
91</refentry>