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">
6 SPDX-License-Identifier: LGPL-2.1+
8 Copyright 2014 Lennart Poettering
11 <refentry id=
"nss-mymachines" conditional='ENABLE_MACHINED'
>
14 <title>nss-mymachines
</title>
15 <productname>systemd
</productname>
19 <contrib>Developer
</contrib>
20 <firstname>Lennart
</firstname>
21 <surname>Poettering
</surname>
22 <email>lennart@poettering.net
</email>
28 <refentrytitle>nss-mymachines
</refentrytitle>
29 <manvolnum>8</manvolnum>
33 <refname>nss-mymachines
</refname>
34 <refname>libnss_mymachines.so
.2</refname>
35 <refpurpose>Provide hostname resolution for local
36 container instances.
</refpurpose>
40 <para><filename>libnss_mymachines.so
.2</filename></para>
44 <title>Description
</title>
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>
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>
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>
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>
67 <title>Example
</title>
69 <para>Here is an example
<filename>/etc/nsswitch.conf
</filename> file that enables
70 <command>nss-mymachines
</command> correctly:
</para>
72 <programlisting>passwd: compat
<command>mymachines
</command> systemd
73 group: compat
<command>mymachines
</command> systemd
76 hosts: files
<command>mymachines
</command> resolve [!UNAVAIL=return] dns myhostname
84 netgroup: nis
</programlisting>
89 <title>See Also
</title>
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>