]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-resolved.service.xml
Merge pull request #2966 from evverx/udev-test-dont-rely-on-underlying-fs
[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 provides network name resolution to local
60 applications. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR resolver and
61 responder. In addition it maintains the <filename>/run/systemd/resolve/resolv.conf</filename> file for
62 compatibility with traditional Linux programs. This file may be symlinked from
63 <filename>/etc/resolv.conf</filename>.</para>
64
65 <para>The glibc NSS module
66 <citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry> is required to
67 permit glibc's NSS resolver functions to resolve 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 hostnames <literal>localhost</literal> and
91 <literal>localhost.localdomain</literal> (as well as any hostname
92 ending in <literal>.localhost</literal> or <literal>.localhost.localdomain</literal>)
93 are resolved to the IP addresses 127.0.0.1 and ::1.</para></listitem>
94
95 <listitem><para>The hostname <literal>gateway</literal> is
96 resolved to all current default routing gateway addresses,
97 ordered by their metric. This assigns a stable hostname to the
98 current gateway, useful for referencing it independently of the
99 current network configuration state.</para></listitem>
100
101 <listitem><para>The mappings defined in <filename>/etc/hosts</filename> are resolved to their configured
102 addresses and back.</para></listitem>
103 </itemizedlist>
104
105 <para>Lookup requests are routed to the available DNS servers
106 and LLMNR interfaces according to the following rules:</para>
107
108 <itemizedlist>
109 <listitem><para>Lookups for the special hostname
110 <literal>localhost</literal> are never routed to the
111 network. (A few other, special domains are handled the same way.)</para></listitem>
112
113 <listitem><para>Single-label names are routed to all local
114 interfaces capable of IP multicasting, using the LLMNR
115 protocol. Lookups for IPv4 addresses are only sent via LLMNR on
116 IPv4, and lookups for IPv6 addresses are only sent via LLMNR on
117 IPv6. Lookups for the locally configured host name and the
118 <literal>gateway</literal> host name are never routed to
119 LLMNR.</para></listitem>
120
121 <listitem><para>Multi-label names are routed to all local
122 interfaces that have a DNS sever configured, plus the globally
123 configured DNS server if there is one. Address lookups from the
124 link-local address range are never routed to
125 DNS.</para></listitem>
126 </itemizedlist>
127
128 <para>If lookups are routed to multiple interfaces, the first
129 successful response is returned (thus effectively merging the
130 lookup zones on all matching interfaces). If the lookup failed on
131 all interfaces, the last failing response is returned.</para>
132
133 <para>Routing of lookups may be influenced by configuring
134 per-interface domain names. See
135 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
136 for details. Lookups for a hostname ending in one of the
137 per-interface domains are exclusively routed to the matching
138 interfaces.</para>
139
140 <para>Note that <filename>/run/systemd/resolve/resolv.conf</filename> should not be used directly by applications,
141 but only through a symlink from <filename>/etc/resolv.conf</filename>.</para>
142
143 <para>See the <ulink url="http://www.freedesktop.org/wiki/Software/systemd/resolved"> resolved D-Bus API
144 Documentation</ulink> for information about the APIs <filename>systemd-resolved</filename> provides.</para>
145
146 </refsect1>
147
148 <refsect1>
149 <title>See Also</title>
150 <para>
151 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
152 <citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
153 <citerefentry><refentrytitle>dnssec-trust-anchors.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
154 <citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
155 <citerefentry><refentrytitle>systemd-resolve</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
156 <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
157 <citerefentry project='man-pages'><refentrytitle>hosts</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
158 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
159 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
160 </para>
161 </refsect1>
162
163 </refentry>