man-pages/man5/systemd.dnssd.5.html
2021-03-31 01:06:50 +01:00

336 lines
8.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SYSTEMD.DNSSD</TITLE>
</HEAD><BODY>
<H1>SYSTEMD.DNSSD</H1>
Section: systemd.dnssd (5)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
systemd.dnssd - DNS-SD configuration
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<I>network_service</I>.dnssd
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
DNS-SD setup is performed by
<B><A HREF="/cgi-bin/man/man2html?8+systemd-resolved">systemd-resolved</A></B>(8).
<P>
The main network service file must have the extension
.dnssd; other extensions are ignored.
<P>
The
.dnssd
files are read from the files located in the system network directories
/usr/lib/systemd/dnssd
and
/usr/local/lib/systemd/dnssd, the volatile runtime network directory
/run/systemd/dnssd
and the local administration network directory
/etc/systemd/dnssd. All configuration files are collectively sorted and processed in lexical order, regardless of the directories in which they live. However, files with identical filenames replace each other. Files in
/etc
have the highest priority, files in
/run
take precedence over files with the same name in
/lib. This can be used to override a system-supplied configuration file with a local file if needed.
<P>
Along with the network service file
foo.dnssd, a &quot;drop-in&quot; directory
foo.dnssd.d/
may exist. All files with the suffix
&quot;.conf&quot;
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.
<P>
In addition to
/etc/systemd/dnssd, drop-in
&quot;.d&quot;
directories can be placed in
/usr/lib/systemd/dnssd
or
/run/systemd/dnssd
directories. Drop-in files in
/etc
take precedence over those in
/run
which in turn take precedence over those in
/usr/lib
or
/usr/local/lib. Drop-in files under any of these directories take precedence over the main network service file wherever located.
<A NAME="lbAE">&nbsp;</A>
<H2>[SERVICE] SECTION OPTIONS</H2>
<P>
The network service file contains a
&quot;[Service]&quot;
section, which specifies a discoverable network service announced in a local network with Multicast DNS broadcasts.
<P>
<I>Name=</I>
<DL COMPACT><DT id="1"><DD>
An instance name of the network service as defined in the section 4.1.1 of
m[blue]<B>RFC 6763</B>m[]<FONT SIZE="-2">[1]</FONT>, e.g.
&quot;webserver&quot;.
<P>
The option supports simple specifier expansion. The following expansions are understood:
<P>
<BR>
<B>Table&nbsp;1.&nbsp;Specifiers available</B>
<TABLE BORDER>
<TR VALIGN=top><TD><B>
Specifier
</B></TD><TD><B>
Meaning
</B></TD><TD><B>
Details
</B><BR></TD></TR>
<TR VALIGN=top><TD>
&quot;%m&quot;
</TD><TD>
Machine ID
</TD><TD>
The machine ID of the running system, formatted as string. See <B><A HREF="/cgi-bin/man/man2html?5+machine-id">machine-id</A></B>(5) for more information.
<BR></TD></TR>
<TR VALIGN=top><TD>
&quot;%b&quot;
</TD><TD>
Boot ID
</TD><TD>
The boot ID of the running system, formatted as string. See <B><A HREF="/cgi-bin/man/man2html?4+random">random</A></B>(4) for more information.
<BR></TD></TR>
<TR VALIGN=top><TD>
&quot;%H&quot;
</TD><TD>
Host name
</TD><TD>
The hostname of the running system.
<BR></TD></TR>
<TR VALIGN=top><TD>
&quot;%v&quot;
</TD><TD>
Kernel release
</TD><TD>
Identical to <B>uname -r</B> output.
<BR></TD></TR>
</TABLE>
<P>
</DL>
<P>
<I>Type=</I>
<DL COMPACT><DT id="2"><DD>
A type of the network service as defined in the section 4.1.2 of
m[blue]<B>RFC 6763</B>m[]<FONT SIZE="-2">[1]</FONT>, e.g.
&quot;_http._tcp&quot;.
</DL>
<P>
<I>Port=</I>
<DL COMPACT><DT id="3"><DD>
An IP port number of the network service.
</DL>
<P>
<I>Priority=</I>
<DL COMPACT><DT id="4"><DD>
A priority number set in SRV resource records corresponding to the network service.
</DL>
<P>
<I>Weight=</I>
<DL COMPACT><DT id="5"><DD>
A weight number set in SRV resource records corresponding to the network service.
</DL>
<P>
<I>TxtText=</I>
<DL COMPACT><DT id="6"><DD>
A whitespace-separated list of arbitrary key/value pairs conveying additional information about the named service in the corresponding TXT resource record, e.g.
&quot;path=/portal/index.html&quot;. Keys and values can contain C-style escape sequences which get translated upon reading configuration files.
<P>
This option together with
<I>TxtData=</I>
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.
</DL>
<P>
<I>TxtData=</I>
<DL COMPACT><DT id="7"><DD>
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.
&quot;data=YW55IGJpbmFyeSBkYXRhCg==&quot;. Keys can contain C-style escape sequences which get translated upon reading configuration files.
<P>
This option together with
<I>TxtText=</I>
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.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>EXAMPLES</H2>
<P>
<B>Example&nbsp;1.&nbsp;HTTP service</B>
<P>
<DL COMPACT><DT id="8"><DD>
<PRE>
# /etc/systemd/dnssd/http.dnssd
[Service]
Name=%H
Type=_http._tcp
Port=80
TxtText=path=/stats/index.html t=temperature_sensor
</PRE>
</DL>
<P>
This makes the http server running on the host discoverable in the local network given MulticastDNS is enabled on the network interface.
<P>
Now the utility
&quot;resolvectl&quot;
should be able to resolve the service to the host's name:
<P>
<DL COMPACT><DT id="9"><DD>
<PRE>
$ resolvectl service meteo._http._tcp.local
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
</PRE>
</DL>
<P>
&quot;Avahi&quot;
running on a different host in the same local network should see the service as well:
<P>
<DL COMPACT><DT id="10"><DD>
<PRE>
$ 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 = [&quot;path=/stats/index.html&quot; &quot;t=temperature_sensor&quot;]
= enp3s0 IPv4 meteo Web Site local
hostname = [meteo.local]
address = [169.254.208.106]
port = [80]
txt = [&quot;path=/stats/index.html&quot; &quot;t=temperature_sensor&quot;]
</PRE>
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?8+systemd-resolved.service">systemd-resolved.service</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?1+resolvectl">resolvectl</A></B>(1)
<A NAME="lbAH">&nbsp;</A>
<H2>NOTES</H2>
<DL COMPACT>
<DT id="11"> 1.<DD>
RFC 6763
<DL COMPACT><DT id="12"><DD>
<A HREF="https://tools.ietf.org/html/rfc6763">https://tools.ietf.org/html/rfc6763</A>
</DL>
<P>
</DL>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="13"><A HREF="#lbAB">NAME</A><DD>
<DT id="14"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="15"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="16"><A HREF="#lbAE">[SERVICE] SECTION OPTIONS</A><DD>
<DT id="17"><A HREF="#lbAF">EXAMPLES</A><DD>
<DT id="18"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="19"><A HREF="#lbAH">NOTES</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:06 GMT, March 31, 2021
</BODY>
</HTML>