2015-08-26 09:00:09 +00:00
|
|
|
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
|
|
|
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
|
|
|
|
|
|
|
<!--
|
2017-11-18 16:22:32 +00:00
|
|
|
SPDX-License-Identifier: LGPL-2.1+
|
|
|
|
|
2015-08-26 09:00:09 +00:00
|
|
|
Copyright 2013 Tom Gundersen
|
|
|
|
-->
|
|
|
|
|
2017-10-03 11:12:29 +00:00
|
|
|
<refentry id="nss-resolve" conditional='ENABLE_RESOLVE'>
|
2015-08-26 09:00:09 +00:00
|
|
|
|
|
|
|
<refentryinfo>
|
|
|
|
<title>nss-resolve</title>
|
|
|
|
<productname>systemd</productname>
|
|
|
|
|
|
|
|
<authorgroup>
|
|
|
|
<author>
|
|
|
|
<contrib>Developer</contrib>
|
|
|
|
<firstname>Lennart</firstname>
|
|
|
|
<surname>Poettering</surname>
|
|
|
|
<email>lennart@poettering.net</email>
|
|
|
|
</author>
|
|
|
|
</authorgroup>
|
|
|
|
</refentryinfo>
|
|
|
|
|
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>nss-resolve</refentrytitle>
|
|
|
|
<manvolnum>8</manvolnum>
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
<refname>nss-resolve</refname>
|
|
|
|
<refname>libnss_resolve.so.2</refname>
|
|
|
|
<refpurpose>Provide hostname resolution via <filename>systemd-resolved.service</filename></refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<para><filename>libnss_resolve.so.2</filename></para>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
2016-02-23 17:24:03 +00:00
|
|
|
<para><command>nss-resolve</command> is a plug-in module for the GNU Name Service Switch (NSS) functionality of the
|
|
|
|
GNU C Library (<command>glibc</command>) enabling it to resolve host names via the
|
|
|
|
<citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry> local network
|
|
|
|
name resolution service. It replaces the <command>nss-dns</command> plug-in module that traditionally resolves
|
|
|
|
hostnames via DNS.</para>
|
|
|
|
|
|
|
|
<para>To activate the NSS module, add <literal>resolve</literal> to the line starting with
|
2017-06-29 00:43:37 +00:00
|
|
|
<literal>hosts:</literal> in <filename>/etc/nsswitch.conf</filename>. Specifically, it is recommended to place
|
|
|
|
<literal>resolve</literal> early in <filename>/etc/nsswitch.conf</filename>'s <literal>hosts:</literal> line (but
|
2016-11-18 16:31:49 +00:00
|
|
|
after the <literal>files</literal> or <literal>mymachines</literal> entries), right before the
|
|
|
|
<literal>dns</literal> entry if it exists, followed by <literal>[!UNAVAIL=return]</literal>, to ensure DNS queries
|
|
|
|
are always routed via
|
|
|
|
<citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry> if it is
|
|
|
|
running, but are routed to <command>nss-dns</command> if this service is not available.</para>
|
2017-06-29 00:43:37 +00:00
|
|
|
|
|
|
|
<para>Note that <command>systemd-resolved</command> will synthesize DNS resource
|
2017-07-03 14:33:42 +00:00
|
|
|
records in a few cases, for example for <literal>localhost</literal> and the
|
2017-06-29 00:43:37 +00:00
|
|
|
current hostname, see
|
|
|
|
<citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
|
|
|
for the full list. This duplicates the functionality of
|
|
|
|
<citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
|
|
|
|
but it is still recommended (see examples below) to keep
|
|
|
|
<command>nss-myhostname</command> configured in
|
|
|
|
<filename>/etc/nsswitch.conf</filename>, to keep those names resolveable if
|
|
|
|
<command>systemd-resolved</command> is not running.</para>
|
2015-08-26 09:00:09 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Example</title>
|
|
|
|
|
2016-02-23 17:24:03 +00:00
|
|
|
<para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables <command>nss-resolve</command>
|
|
|
|
correctly:</para>
|
2015-08-26 09:00:09 +00:00
|
|
|
|
2016-07-14 17:19:49 +00:00
|
|
|
<programlisting>passwd: compat mymachines systemd
|
|
|
|
group: compat mymachines systemd
|
2015-08-26 09:00:09 +00:00
|
|
|
shadow: compat
|
|
|
|
|
2016-10-24 16:58:03 +00:00
|
|
|
hosts: files mymachines <command>resolve [!UNAVAIL=return]</command> dns myhostname
|
2015-08-26 09:00:09 +00:00
|
|
|
networks: files
|
|
|
|
|
|
|
|
protocols: db files
|
|
|
|
services: db files
|
|
|
|
ethers: db files
|
|
|
|
rpc: db files
|
|
|
|
|
|
|
|
netgroup: nis</programlisting>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
<para>
|
|
|
|
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
|
|
|
<citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
|
2016-07-14 17:19:49 +00:00
|
|
|
<citerefentry><refentrytitle>nss-systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
|
2015-08-26 09:00:09 +00:00
|
|
|
<citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
|
2016-07-14 17:19:49 +00:00
|
|
|
<citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
|
2015-08-26 09:00:09 +00:00
|
|
|
<citerefentry project='man-pages'><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
</refentry>
|