2018-07-03 05:15:39 +08:00
|
|
|
<?xml version='1.0'?>
|
2019-03-14 21:40:58 +08:00
|
|
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
2023-12-25 22:48:33 +08:00
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
|
2020-11-09 12:23:58 +08:00
|
|
|
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
|
2017-10-04 20:56:19 +08:00
|
|
|
|
2020-04-29 04:50:50 +08:00
|
|
|
<refentry id="systemd.dnssd"
|
|
|
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
|
|
conditional='ENABLE_RESOLVE'>
|
2017-10-04 20:56:19 +08:00
|
|
|
|
|
|
|
<refentryinfo>
|
|
|
|
<title>systemd.dnssd</title>
|
|
|
|
<productname>systemd</productname>
|
|
|
|
</refentryinfo>
|
|
|
|
|
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>systemd.dnssd</refentrytitle>
|
|
|
|
<manvolnum>5</manvolnum>
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
<refname>systemd.dnssd</refname>
|
|
|
|
<refpurpose>DNS-SD configuration</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<para><filename><replaceable>network_service</replaceable>.dnssd</filename></para>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
|
|
|
<para>DNS-SD setup is performed by
|
|
|
|
<citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>The main network service file must have the extension <filename>.dnssd</filename>; other
|
|
|
|
extensions are ignored.</para>
|
|
|
|
|
2019-01-02 21:20:00 +08:00
|
|
|
<para>The <filename>.dnssd</filename> files are read from the files located in the system network
|
|
|
|
directories <filename>/usr/lib/systemd/dnssd</filename> and
|
|
|
|
<filename>/usr/local/lib/systemd/dnssd</filename>, the volatile runtime network directory
|
|
|
|
<filename>/run/systemd/dnssd</filename> and the local administration network directory
|
|
|
|
<filename>/etc/systemd/dnssd</filename>. All configuration files are collectively sorted and processed in
|
|
|
|
lexical order, regardless of the directories in which they live. However, files with identical filenames
|
2020-10-06 00:08:21 +08:00
|
|
|
replace each other. Files in <filename>/etc/</filename> have the highest priority, files in
|
|
|
|
<filename>/run/</filename> take precedence over files with the same name in
|
|
|
|
<filename>/usr/lib/</filename>. This can be used to override a system-supplied configuration file with a
|
2019-01-02 21:20:00 +08:00
|
|
|
local file if needed.</para>
|
2017-10-04 20:56:19 +08:00
|
|
|
|
|
|
|
<para>Along with the network service file <filename>foo.dnssd</filename>, a "drop-in" directory
|
|
|
|
<filename>foo.dnssd.d/</filename> may exist. All files with the suffix
|
|
|
|
<literal>.conf</literal> from this directory will be parsed after the file itself is
|
|
|
|
parsed. This is useful to alter or add configuration settings, without having to modify the main
|
|
|
|
configuration file. Each drop-in file must have appropriate section headers.</para>
|
|
|
|
|
2019-01-02 21:20:00 +08:00
|
|
|
<para>In addition to <filename>/etc/systemd/dnssd</filename>, drop-in <literal>.d</literal> directories
|
|
|
|
can be placed in <filename>/usr/lib/systemd/dnssd</filename> or <filename>/run/systemd/dnssd</filename>
|
2020-10-06 00:08:21 +08:00
|
|
|
directories. Drop-in files in <filename>/etc/</filename> take precedence over those in
|
|
|
|
<filename>/run/</filename> which in turn take precedence over those in <filename>/usr/lib/</filename> or
|
2019-01-02 21:20:00 +08:00
|
|
|
<filename>/usr/local/lib</filename>. Drop-in files under any of these directories take precedence over
|
|
|
|
the main network service file wherever located.</para>
|
2017-10-04 20:56:19 +08:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>[Service] Section Options</title>
|
|
|
|
|
2020-07-06 17:00:06 +08:00
|
|
|
<para>The network service file contains a [Service]
|
2017-10-04 20:56:19 +08:00
|
|
|
section, which specifies a discoverable network service announced in a
|
|
|
|
local network with Multicast DNS broadcasts.</para>
|
|
|
|
|
|
|
|
<variablelist class='network-directives'>
|
|
|
|
<varlistentry>
|
|
|
|
<term><varname>Name=</varname></term>
|
|
|
|
<listitem>
|
|
|
|
<para>An instance name of the network service as defined in the section 4.1.1 of <ulink
|
|
|
|
url="https://tools.ietf.org/html/rfc6763">RFC 6763</ulink>, e.g. <literal>webserver</literal>.</para>
|
|
|
|
<para>The option supports simple specifier expansion. The following expansions are understood:</para>
|
2020-05-07 20:59:24 +08:00
|
|
|
<table class='specifiers'>
|
2017-10-04 20:56:19 +08:00
|
|
|
<title>Specifiers available</title>
|
|
|
|
<tgroup cols='3' align='left' colsep='1' rowsep='1'>
|
|
|
|
<colspec colname="spec" />
|
|
|
|
<colspec colname="mean" />
|
|
|
|
<colspec colname="detail" />
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Specifier</entry>
|
|
|
|
<entry>Meaning</entry>
|
|
|
|
<entry>Details</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2020-04-29 04:50:50 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="a"/>
|
2021-03-23 23:10:31 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="A"/>
|
2020-04-30 18:26:11 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="b"/>
|
2020-04-29 04:50:50 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="B"/>
|
2020-04-30 18:26:11 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="H"/>
|
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="m"/>
|
2021-03-23 23:10:31 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="M"/>
|
2020-04-29 04:50:50 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="o"/>
|
2020-04-30 18:26:11 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="v"/>
|
2020-04-29 04:50:50 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="w"/>
|
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="W"/>
|
2020-04-30 18:26:11 +08:00
|
|
|
<xi:include href="standard-specifiers.xml" xpointer="percent"/>
|
2017-10-04 20:56:19 +08:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2023-08-23 00:52:36 +08:00
|
|
|
|
|
|
|
<xi:include href="version-info.xml" xpointer="v236"/>
|
2017-10-04 20:56:19 +08:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><varname>Type=</varname></term>
|
|
|
|
<listitem>
|
|
|
|
<para>A type of the network service as defined in the section 4.1.2 of <ulink
|
|
|
|
url="https://tools.ietf.org/html/rfc6763">RFC 6763</ulink>, e.g. <literal>_http._tcp</literal>.
|
|
|
|
</para>
|
2023-08-23 00:52:36 +08:00
|
|
|
|
|
|
|
<xi:include href="version-info.xml" xpointer="v236"/>
|
2017-10-04 20:56:19 +08:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2023-12-16 13:55:54 +08:00
|
|
|
<varlistentry>
|
|
|
|
<term><varname>SubType=</varname></term>
|
|
|
|
<listitem>
|
|
|
|
<para>A subtype of the network service as defined in the section 7.1 of <ulink
|
|
|
|
url="https://tools.ietf.org/html/rfc6763">RFC 6763</ulink>, e.g. <literal>_printer</literal>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<xi:include href="version-info.xml" xpointer="v256"/>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2017-10-04 20:56:19 +08:00
|
|
|
<varlistentry>
|
|
|
|
<term><varname>Port=</varname></term>
|
|
|
|
<listitem>
|
|
|
|
<para>An IP port number of the network service.</para>
|
2023-08-23 00:52:36 +08:00
|
|
|
|
|
|
|
<xi:include href="version-info.xml" xpointer="v236"/>
|
2017-10-04 20:56:19 +08:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><varname>Priority=</varname></term>
|
|
|
|
<listitem>
|
2021-06-27 22:20:38 +08:00
|
|
|
<para>A priority number set in <constant class='dns'>SRV</constant> resource records corresponding
|
|
|
|
to the network service.</para>
|
2023-08-23 00:52:36 +08:00
|
|
|
|
|
|
|
<xi:include href="version-info.xml" xpointer="v236"/>
|
2017-10-04 20:56:19 +08:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><varname>Weight=</varname></term>
|
|
|
|
<listitem>
|
2021-06-27 22:20:38 +08:00
|
|
|
<para>A weight number set in <constant class='dns'>SRV</constant> resource records corresponding
|
|
|
|
to the network service.</para>
|
2023-08-23 00:52:36 +08:00
|
|
|
|
|
|
|
<xi:include href="version-info.xml" xpointer="v236"/>
|
2017-10-04 20:56:19 +08:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><varname>TxtText=</varname></term>
|
|
|
|
<listitem>
|
|
|
|
<para>A whitespace-separated list of arbitrary key/value pairs
|
|
|
|
conveying additional information about the named service in the corresponding TXT resource record,
|
|
|
|
e.g. <literal>path=/portal/index.html</literal>. Keys and values can contain C-style escape
|
|
|
|
sequences which get translated upon reading configuration files.
|
|
|
|
</para>
|
2017-11-29 17:03:44 +08:00
|
|
|
<para>This option together with <varname>TxtData=</varname> may be specified more than once, in which
|
|
|
|
case multiple TXT resource records will be created for the service. If the empty string is assigned to
|
|
|
|
this option, the list is reset and all prior assignments will have no effect.
|
|
|
|
</para>
|
2023-08-23 00:52:36 +08:00
|
|
|
|
|
|
|
<xi:include href="version-info.xml" xpointer="v236"/>
|
2017-10-04 20:56:19 +08:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><varname>TxtData=</varname></term>
|
|
|
|
<listitem>
|
|
|
|
<para>A whitespace-separated list of arbitrary key/value pairs
|
|
|
|
conveying additional information about the named service in the corresponding TXT resource record
|
|
|
|
where values are base64-encoded string representing any binary data,
|
|
|
|
e.g. <literal>data=YW55IGJpbmFyeSBkYXRhCg==</literal>. Keys can contain C-style escape
|
|
|
|
sequences which get translated upon reading configuration files.
|
|
|
|
</para>
|
2017-11-29 17:03:44 +08:00
|
|
|
<para>This option together with <varname>TxtText=</varname> may be specified more than once, in which
|
|
|
|
case multiple TXT resource records will be created for the service. If the empty string is assigned to
|
|
|
|
this option, the list is reset and all prior assignments will have no effect.
|
|
|
|
</para>
|
2023-08-23 00:52:36 +08:00
|
|
|
|
|
|
|
<xi:include href="version-info.xml" xpointer="v236"/>
|
2017-10-04 20:56:19 +08:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Examples</title>
|
|
|
|
<example>
|
|
|
|
<title>HTTP service</title>
|
|
|
|
|
|
|
|
<programlisting># /etc/systemd/dnssd/http.dnssd
|
|
|
|
[Service]
|
2017-12-21 20:55:29 +08:00
|
|
|
Name=%H
|
2017-10-04 20:56:19 +08:00
|
|
|
Type=_http._tcp
|
|
|
|
Port=80
|
|
|
|
TxtText=path=/stats/index.html t=temperature_sensor</programlisting>
|
|
|
|
|
|
|
|
<para>This makes the http server running on the host discoverable in the local network
|
|
|
|
given MulticastDNS is enabled on the network interface.</para>
|
|
|
|
|
2018-04-19 02:25:25 +08:00
|
|
|
<para>Now the utility <literal>resolvectl</literal> should be able to resolve the
|
2017-10-04 20:56:19 +08:00
|
|
|
service to the host's name:</para>
|
|
|
|
|
2018-04-19 02:25:25 +08:00
|
|
|
<programlisting>$ resolvectl service meteo._http._tcp.local
|
2017-10-04 20:56:19 +08:00
|
|
|
meteo._http._tcp.local: meteo.local:80 [priority=0, weight=0]
|
|
|
|
169.254.208.106%senp0s21f0u2u4
|
|
|
|
fe80::213:3bff:fe49:8aa%senp0s21f0u2u4
|
|
|
|
path=/stats/index.html
|
|
|
|
t=temperature_sensor
|
|
|
|
(meteo/_http._tcp/local)
|
|
|
|
|
|
|
|
-- Information acquired via protocol mDNS/IPv6 in 4.0ms.
|
|
|
|
-- Data is authenticated: yes</programlisting>
|
|
|
|
|
|
|
|
<para><literal>Avahi</literal> running on a different host in the same local network should see the service as well:</para>
|
|
|
|
|
|
|
|
<programlisting>$ avahi-browse -a -r
|
|
|
|
+ enp3s0 IPv6 meteo Web Site local
|
|
|
|
+ enp3s0 IPv4 meteo Web Site local
|
|
|
|
= enp3s0 IPv6 meteo Web Site local
|
|
|
|
hostname = [meteo.local]
|
|
|
|
address = [fe80::213:3bff:fe49:8aa]
|
|
|
|
port = [80]
|
|
|
|
txt = ["path=/stats/index.html" "t=temperature_sensor"]
|
|
|
|
= enp3s0 IPv4 meteo Web Site local
|
|
|
|
hostname = [meteo.local]
|
|
|
|
address = [169.254.208.106]
|
|
|
|
port = [80]
|
|
|
|
txt = ["path=/stats/index.html" "t=temperature_sensor"]</programlisting>
|
|
|
|
|
|
|
|
</example>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
2023-12-23 02:09:32 +08:00
|
|
|
<para><simplelist type="inline">
|
|
|
|
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
|
|
|
|
<member><citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
|
|
|
|
<member><citerefentry><refentrytitle>resolvectl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
|
|
|
|
</simplelist></para>
|
2017-10-04 20:56:19 +08:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
</refentry>
|