]> git.proxmox.com Git - systemd.git/blame - man/nss-mymachines.xml
New upstream version 236
[systemd.git] / man / nss-mymachines.xml
CommitLineData
e735f4d4
MP
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<!--
52ad194e
MB
6 SPDX-License-Identifier: LGPL-2.1+
7
e735f4d4
MP
8 This file is part of systemd.
9
10 Copyright 2014 Lennart Poettering
11
12 systemd is free software; you can redistribute it and/or modify it
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
15 (at your option) any later version.
16
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public License
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24-->
25
26<refentry id="nss-mymachines" conditional='ENABLE_MACHINED'>
27
28 <refentryinfo>
29 <title>nss-mymachines</title>
30 <productname>systemd</productname>
31
32 <authorgroup>
33 <author>
34 <contrib>Developer</contrib>
35 <firstname>Lennart</firstname>
36 <surname>Poettering</surname>
37 <email>lennart@poettering.net</email>
38 </author>
39 </authorgroup>
40 </refentryinfo>
41
42 <refmeta>
43 <refentrytitle>nss-mymachines</refentrytitle>
44 <manvolnum>8</manvolnum>
45 </refmeta>
46
47 <refnamediv>
48 <refname>nss-mymachines</refname>
49 <refname>libnss_mymachines.so.2</refname>
50 <refpurpose>Provide hostname resolution for local
51 container instances.</refpurpose>
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <para><filename>libnss_mymachines.so.2</filename></para>
56 </refsynopsisdiv>
57
58 <refsect1>
59 <title>Description</title>
60
aa27b158
MP
61 <para><command>nss-mymachines</command> is a plug-in module for the GNU Name Service Switch (NSS) functionality of
62 the GNU C Library (<command>glibc</command>), providing hostname resolution for the names of containers running
63 locally that are registered with
64 <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. The
65 container names are resolved to the IP addresses of the specific container, ordered by their scope. This
66 functionality only applies to containers using network namespacing.</para>
67
68 <para>The module also resolves user and group IDs used by containers to user and group names indicating the
69 container name, and back. This functionality only applies to containers using user namespacing.</para>
70
71 <para>To activate the NSS module, add <literal>mymachines</literal> to the lines starting with
72 <literal>hosts:</literal>, <literal>passwd:</literal> and <literal>group:</literal> in
e735f4d4
MP
73 <filename>/etc/nsswitch.conf</filename>.</para>
74
aa27b158
MP
75 <para>It is recommended to place <literal>mymachines</literal> after the <literal>files</literal> or
76 <literal>compat</literal> entry of the <filename>/etc/nsswitch.conf</filename> lines to make sure that its mappings
77 are preferred over other resolvers such as DNS, but so that <filename>/etc/hosts</filename>,
78 <filename>/etc/passwd</filename> and <filename>/etc/group</filename> based mappings take precedence.</para>
e735f4d4
MP
79 </refsect1>
80
81 <refsect1>
82 <title>Example</title>
83
aa27b158
MP
84 <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables
85 <command>nss-mymachines</command> correctly:</para>
e735f4d4 86
8a584da2
MP
87 <programlisting>passwd: compat <command>mymachines</command> systemd
88group: compat <command>mymachines</command> systemd
7035cd9e 89shadow: compat
e735f4d4 90
8a584da2 91hosts: files <command>mymachines</command> resolve [!UNAVAIL=return] dns myhostname
e735f4d4
MP
92networks: files
93
94protocols: db files
95services: db files
7035cd9e
MP
96ethers: db files
97rpc: db files
e735f4d4
MP
98
99netgroup: nis</programlisting>
100
101 </refsect1>
102
103 <refsect1>
104 <title>See Also</title>
105 <para>
106 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
107 <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
8a584da2 108 <citerefentry><refentrytitle>nss-systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
13d276d0 109 <citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
e735f4d4
MP
110 <citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
111 <citerefentry project='man-pages'><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
112 <citerefentry project='man-pages'><refentrytitle>getent</refentrytitle><manvolnum>1</manvolnum></citerefentry>
113 </para>
114 </refsect1>
115
116</refentry>