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