]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.dnssd.xml
tree-wide: drop license boilerplate
[thirdparty/systemd.git] / man / systemd.dnssd.xml
CommitLineData
6e73d91e
DR
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 2017 Dmitry Rozhkov
6e73d91e
DR
9-->
10
11<refentry id="systemd.dnssd" conditional='ENABLE_RESOLVE'>
12
13 <refentryinfo>
14 <title>systemd.dnssd</title>
15 <productname>systemd</productname>
16
17 <authorgroup>
18 <author>
19 <contrib>Developer</contrib>
20 <firstname>Dmitry</firstname>
21 <surname>Rozhkov</surname>
22 <email>dmitry.rozhkov@intel.com</email>
23 </author>
24 </authorgroup>
25 </refentryinfo>
26
27 <refmeta>
28 <refentrytitle>systemd.dnssd</refentrytitle>
29 <manvolnum>5</manvolnum>
30 </refmeta>
31
32 <refnamediv>
33 <refname>systemd.dnssd</refname>
34 <refpurpose>DNS-SD configuration</refpurpose>
35 </refnamediv>
36
37 <refsynopsisdiv>
38 <para><filename><replaceable>network_service</replaceable>.dnssd</filename></para>
39 </refsynopsisdiv>
40
41 <refsect1>
42 <title>Description</title>
43
44 <para>DNS-SD setup is performed by
45 <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
46 </para>
47
48 <para>The main network service file must have the extension <filename>.dnssd</filename>; other
49 extensions are ignored.</para>
50
51 <para>The <filename>.dnssd</filename> files are read from the files located in the system
52 network directory <filename>/usr/lib/systemd/dnssd</filename>, the volatile runtime network
53 directory <filename>/run/systemd/dnssd</filename> and the local administration network
54 directory <filename>/etc/systemd/dnssd</filename>. All configuration files are collectively
55 sorted and processed in lexical order, regardless of the directories in which they live.
56 However, files with identical filenames replace each other. Files in <filename>/etc</filename>
57 have the highest priority, files in <filename>/run</filename> take precedence over files with
58 the same name in <filename>/usr/lib</filename>. This can be used to override a system-supplied
59 configuration file with a local file if needed.</para>
60
61 <para>Along with the network service file <filename>foo.dnssd</filename>, a "drop-in" directory
62 <filename>foo.dnssd.d/</filename> may exist. All files with the suffix
63 <literal>.conf</literal> from this directory will be parsed after the file itself is
64 parsed. This is useful to alter or add configuration settings, without having to modify the main
65 configuration file. Each drop-in file must have appropriate section headers.</para>
66
67 <para>In addition to <filename>/etc/systemd/dnssd</filename>, drop-in <literal>.d</literal>
68 directories can be placed in <filename>/usr/lib/systemd/dnssd</filename> or
69 <filename>/run/systemd/dnssd</filename> directories. Drop-in files in
70 <filename>/etc</filename> take precedence over those in <filename>/run</filename> which in turn
71 take precedence over those in <filename>/usr/lib</filename>. Drop-in files under any of these
72 directories take precedence over the main network service file wherever located. (Of course, since
73 <filename>/run</filename> is temporary and <filename>/usr/lib</filename> is for vendors, it is
74 unlikely drop-ins should be used in either of those places.)</para>
75 </refsect1>
76
77 <refsect1>
78 <title>[Service] Section Options</title>
79
80 <para>The network service file contains a <literal>[Service]</literal>
81 section, which specifies a discoverable network service announced in a
82 local network with Multicast DNS broadcasts.</para>
83
84 <variablelist class='network-directives'>
85 <varlistentry>
86 <term><varname>Name=</varname></term>
87 <listitem>
88 <para>An instance name of the network service as defined in the section 4.1.1 of <ulink
89 url="https://tools.ietf.org/html/rfc6763">RFC 6763</ulink>, e.g. <literal>webserver</literal>.</para>
90 <para>The option supports simple specifier expansion. The following expansions are understood:</para>
91 <table>
92 <title>Specifiers available</title>
93 <tgroup cols='3' align='left' colsep='1' rowsep='1'>
94 <colspec colname="spec" />
95 <colspec colname="mean" />
96 <colspec colname="detail" />
97 <thead>
98 <row>
99 <entry>Specifier</entry>
100 <entry>Meaning</entry>
101 <entry>Details</entry>
102 </row>
103 </thead>
104 <tbody>
105 <row>
106 <entry><literal>%m</literal></entry>
107 <entry>Machine ID</entry>
108 <entry>The machine ID of the running system, formatted as string. See <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.</entry>
109 </row>
110 <row>
111 <entry><literal>%b</literal></entry>
112 <entry>Boot ID</entry>
113 <entry>The boot ID of the running system, formatted as string. See <citerefentry><refentrytitle>random</refentrytitle><manvolnum>4</manvolnum></citerefentry> for more information.</entry>
114 </row>
115 <row>
116 <entry><literal>%H</literal></entry>
117 <entry>Host name</entry>
118 <entry>The hostname of the running system.</entry>
119 </row>
120 <row>
121 <entry><literal>%v</literal></entry>
122 <entry>Kernel release</entry>
123 <entry>Identical to <command>uname -r</command> output.</entry>
124 </row>
125 </tbody>
126 </tgroup>
127 </table>
128 </listitem>
129 </varlistentry>
130 <varlistentry>
131 <term><varname>Type=</varname></term>
132 <listitem>
133 <para>A type of the network service as defined in the section 4.1.2 of <ulink
134 url="https://tools.ietf.org/html/rfc6763">RFC 6763</ulink>, e.g. <literal>_http._tcp</literal>.
135 </para>
136 </listitem>
137 </varlistentry>
138 <varlistentry>
139 <term><varname>Port=</varname></term>
140 <listitem>
141 <para>An IP port number of the network service.</para>
142 </listitem>
143 </varlistentry>
144 <varlistentry>
145 <term><varname>Priority=</varname></term>
146 <listitem>
147 <para>A priority number set in SRV resource records corresponding to the network service.</para>
148 </listitem>
149 </varlistentry>
150 <varlistentry>
151 <term><varname>Weight=</varname></term>
152 <listitem>
153 <para>A weight number set in SRV resource records corresponding to the network service.</para>
154 </listitem>
155 </varlistentry>
156 <varlistentry>
157 <term><varname>TxtText=</varname></term>
158 <listitem>
159 <para>A whitespace-separated list of arbitrary key/value pairs
160 conveying additional information about the named service in the corresponding TXT resource record,
161 e.g. <literal>path=/portal/index.html</literal>. Keys and values can contain C-style escape
162 sequences which get translated upon reading configuration files.
163 </para>
400f54fb
DR
164 <para>This option together with <varname>TxtData=</varname> may be specified more than once, in which
165 case multiple TXT resource records will be created for the service. If the empty string is assigned to
166 this option, the list is reset and all prior assignments will have no effect.
167 </para>
6e73d91e
DR
168 </listitem>
169 </varlistentry>
170 <varlistentry>
171 <term><varname>TxtData=</varname></term>
172 <listitem>
173 <para>A whitespace-separated list of arbitrary key/value pairs
174 conveying additional information about the named service in the corresponding TXT resource record
175 where values are base64-encoded string representing any binary data,
176 e.g. <literal>data=YW55IGJpbmFyeSBkYXRhCg==</literal>. Keys can contain C-style escape
177 sequences which get translated upon reading configuration files.
178 </para>
400f54fb
DR
179 <para>This option together with <varname>TxtText=</varname> may be specified more than once, in which
180 case multiple TXT resource records will be created for the service. If the empty string is assigned to
181 this option, the list is reset and all prior assignments will have no effect.
182 </para>
6e73d91e
DR
183 </listitem>
184 </varlistentry>
185 </variablelist>
186
187 </refsect1>
188
189 <refsect1>
190 <title>Examples</title>
191 <example>
192 <title>HTTP service</title>
193
194 <programlisting># /etc/systemd/dnssd/http.dnssd
195[Service]
5526ac50 196Name=%H
6e73d91e
DR
197Type=_http._tcp
198Port=80
199TxtText=path=/stats/index.html t=temperature_sensor</programlisting>
200
201 <para>This makes the http server running on the host discoverable in the local network
202 given MulticastDNS is enabled on the network interface.</para>
203
204 <para>Now the utility <literal>systemd-resolve</literal> should be able to resolve the
205 service to the host's name:</para>
206
207 <programlisting>$ systemd-resolve --service meteo._http._tcp.local
208meteo._http._tcp.local: meteo.local:80 [priority=0, weight=0]
209 169.254.208.106%senp0s21f0u2u4
210 fe80::213:3bff:fe49:8aa%senp0s21f0u2u4
211 path=/stats/index.html
212 t=temperature_sensor
213 (meteo/_http._tcp/local)
214
215-- Information acquired via protocol mDNS/IPv6 in 4.0ms.
216-- Data is authenticated: yes</programlisting>
217
218 <para><literal>Avahi</literal> running on a different host in the same local network should see the service as well:</para>
219
220 <programlisting>$ avahi-browse -a -r
221+ enp3s0 IPv6 meteo Web Site local
222+ enp3s0 IPv4 meteo Web Site local
223= enp3s0 IPv6 meteo Web Site local
224 hostname = [meteo.local]
225 address = [fe80::213:3bff:fe49:8aa]
226 port = [80]
227 txt = ["path=/stats/index.html" "t=temperature_sensor"]
228= enp3s0 IPv4 meteo Web Site local
229 hostname = [meteo.local]
230 address = [169.254.208.106]
231 port = [80]
232 txt = ["path=/stats/index.html" "t=temperature_sensor"]</programlisting>
233
234 </example>
235 </refsect1>
236
237 <refsect1>
238 <title>See Also</title>
239 <para>
240 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
241 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
242 </para>
243 </refsect1>
244
245</refentry>