]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-resolved.service.xml
test-execute: Add tests for new PassEnvironment= directive
[thirdparty/systemd.git] / man / systemd-resolved.service.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
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 This file is part of systemd.
7
8 Copyright 2014 Tom Gundersen
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd-resolved.service" conditional='ENABLE_RESOLVED'>
25
26 <refentryinfo>
27 <title>systemd-resolved.service</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Tom</firstname>
34 <surname>Gundersen</surname>
35 <email>teg@jklm.no</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>systemd-resolved.service</refentrytitle>
42 <manvolnum>8</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemd-resolved.service</refname>
47 <refname>systemd-resolved</refname>
48 <refpurpose>Network Name Resolution manager</refpurpose>
49 </refnamediv>
50
51 <refsynopsisdiv>
52 <para><filename>systemd-resolved.service</filename></para>
53 <para><filename>/usr/lib/systemd/systemd-resolved</filename></para>
54 </refsynopsisdiv>
55
56 <refsect1>
57 <title>Description</title>
58
59 <para><command>systemd-resolved</command> is a system service that
60 manages network name resolution. It implements a caching DNS stub
61 resolver and an LLMNR resolver and responder. It also generates
62 <filename>/run/systemd/resolve/resolv.conf</filename> for
63 compatibility which may be symlinked from
64 <filename>/etc/resolv.conf</filename>. The glibc NSS module
65 <citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>
66 is necessary to allow libc's NSS resolver functions to resolve
67 host names via <command>systemd-resolved</command>.</para>
68
69 <para>The DNS servers contacted are determined from the global
70 settings in <filename>/etc/systemd/resolved.conf</filename>, the
71 per-link static settings in <filename>/etc/systemd/network/*.network</filename> files,
72 and the per-link dynamic settings received over DHCP. See
73 <citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
74 and
75 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
76 for details. To improve compatibility,
77 <filename>/etc/resolv.conf</filename> is read in order to discover
78 configured system DNS servers, but only if it is not a symlink
79 to <filename>/run/systemd/resolve/resolv.conf</filename> (see above).</para>
80
81 <para><command>systemd-resolved</command> synthesizes DNS RRs for the following cases:</para>
82
83 <itemizedlist>
84 <listitem><para>The local, configured hostname is resolved to
85 all locally configured IP addresses ordered by their scope, or
86 — if none are configured — the IPv4 address 127.0.0.2 (which
87 is on the local loopback) and the IPv6 address ::1 (which is the
88 local host).</para></listitem>
89
90 <listitem><para>The hostname <literal>localhost</literal> is
91 resolved to the IP addresses 127.0.0.1 and
92 ::1.</para></listitem>
93
94 <listitem><para>The hostname <literal>gateway</literal> is
95 resolved to all current default routing gateway addresses,
96 ordered by their metric. This assigns a stable hostname to the
97 current gateway, useful for referencing it independently of the
98 current network configuration state.</para></listitem>
99 </itemizedlist>
100
101 <para>Lookup requests are routed to the available DNS servers
102 and LLMNR interfaces according to the following rules:</para>
103
104 <itemizedlist>
105 <listitem><para>Lookups for the special hostname
106 <literal>localhost</literal> are never routed to the
107 network.</para></listitem>
108
109 <listitem><para>Single-label names are routed to all local
110 interfaces capable of IP multicasting, using the LLMNR
111 protocol. Lookups for IPv4 addresses are only sent via LLMNR on
112 IPv4, and lookups for IPv6 addresses are only sent via LLMNR on
113 IPv6. Lookups for the locally configured host name and the
114 <literal>gateway</literal> host name are never routed to
115 LLMNR.</para></listitem>
116
117 <listitem><para>Multi-label names are routed to all local
118 interfaces that have a DNS sever configured, plus the globally
119 configured DNS server if there is one. Address lookups from the
120 link-local addres range are never routed to
121 DNS.</para></listitem>
122 </itemizedlist>
123
124 <para>If lookups are routed to multiple interfaces, the first
125 successful response is returned (thus effectively merging the
126 lookup zones on all matching interfaces). If the lookup failed on
127 all interfaces, the last failing response is returned.</para>
128
129 <para>Routing of lookups may be influenced by configuring
130 per-interface domain names. See
131 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
132 for details. Lookups for a hostname ending in one of the
133 per-interface domains are exclusively routed to the matching
134 interfaces.</para>
135
136 <para>Note that
137 <filename>/run/systemd/resolve/resolv.conf</filename> should not
138 be used directly, but only through a symlink from
139 <filename>/etc/resolv.conf</filename>.</para>
140 </refsect1>
141
142 <refsect1>
143 <title>See Also</title>
144 <para>
145 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
146 <citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
147 <citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
148 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
149 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
150 </para>
151 </refsect1>
152
153 </refentry>