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