]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/nss-mymachines.xml
tree-wide: drop license boilerplate
[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
ZJS
6 SPDX-License-Identifier: LGPL-2.1+
7
dbda6dce
LP
8 This file is part of systemd.
9
10 Copyright 2014 Lennart Poettering
dbda6dce
LP
11-->
12
13<refentry id="nss-mymachines" conditional='ENABLE_MACHINED'>
14
798d3a52
ZJS
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
9053aaad
LP
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
798d3a52
ZJS
60 <filename>/etc/nsswitch.conf</filename>.</para>
61
9053aaad
LP
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>
798d3a52
ZJS
66 </refsect1>
67
68 <refsect1>
69 <title>Example</title>
70
9053aaad
LP
71 <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables
72 <command>nss-mymachines</command> correctly:</para>
798d3a52 73
409093fe
LP
74 <programlisting>passwd: compat <command>mymachines</command> systemd
75group: compat <command>mymachines</command> systemd
c01ff965 76shadow: compat
798d3a52 77
75555c28 78hosts: files <command>mymachines</command> resolve [!UNAVAIL=return] dns myhostname
dbda6dce
LP
79networks: files
80
81protocols: db files
82services: db files
c01ff965
LP
83ethers: db files
84rpc: db files
dbda6dce
LP
85
86netgroup: nis</programlisting>
87
798d3a52
ZJS
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>,
409093fe 95 <citerefentry><refentrytitle>nss-systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
0d6868f9 96 <citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
798d3a52
ZJS
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>
dbda6dce
LP
102
103</refentry>