1SYSTEMD.DNSSD(5)                 systemd.dnssd                SYSTEMD.DNSSD(5)
2
3
4

NAME

6       systemd.dnssd - DNS-SD configuration
7

SYNOPSIS

9       network_service.dnssd
10

DESCRIPTION

12       DNS-SD setup is performed by systemd-resolved(8).
13
14       The main network service file must have the extension .dnssd; other
15       extensions are ignored.
16
17       The .dnssd files are read from the files located in the system network
18       directories /usr/lib/systemd/dnssd and /usr/local/lib/systemd/dnssd,
19       the volatile runtime network directory /run/systemd/dnssd and the local
20       administration network directory /etc/systemd/dnssd. All configuration
21       files are collectively sorted and processed in lexical order,
22       regardless of the directories in which they live. However, files with
23       identical filenames replace each other. Files in /etc have the highest
24       priority, files in /run take precedence over files with the same name
25       in /usr/lib. This can be used to override a system-supplied
26       configuration file with a local file if needed.
27
28       Along with the network service file foo.dnssd, a "drop-in" directory
29       foo.dnssd.d/ may exist. All files with the suffix ".conf" from this
30       directory will be parsed after the file itself is parsed. This is
31       useful to alter or add configuration settings, without having to modify
32       the main configuration file. Each drop-in file must have appropriate
33       section headers.
34
35       In addition to /etc/systemd/dnssd, drop-in ".d" directories can be
36       placed in /usr/lib/systemd/dnssd or /run/systemd/dnssd directories.
37       Drop-in files in /etc take precedence over those in /run which in turn
38       take precedence over those in /usr/lib or /usr/local/lib. Drop-in files
39       under any of these directories take precedence over the main network
40       service file wherever located.
41

[SERVICE] SECTION OPTIONS

43       The network service file contains a [Service] section, which specifies
44       a discoverable network service announced in a local network with
45       Multicast DNS broadcasts.
46
47       Name=
48           An instance name of the network service as defined in the section
49           4.1.1 of RFC 6763[1], e.g.  "webserver".
50
51           The option supports simple specifier expansion. The following
52           expansions are understood:
53
54           Table 1. Specifiers available
55           ┌──────────┬─────────────────────┬────────────────────────┐
56Specifier Meaning             Details                
57           ├──────────┼─────────────────────┼────────────────────────┤
58           │"%a"      │ Architecture        │ A short string         │
59           │          │                     │ identifying the        │
60           │          │                     │ architecture of the    │
61           │          │                     │ local system. A        │
62           │          │                     │ string such as x86,    │
63           │          │                     │ x86-64 or arm64.       │
64           │          │                     │ See the                │
65           │          │                     │ architectures          │
66           │          │                     │ defined for            │
67           │          │                     │ ConditionArchitecture=
68           │          │                     │ in systemd.unit(5)
69           │          │                     │ for a full list.       │
70           ├──────────┼─────────────────────┼────────────────────────┤
71           │"%b"      │ Boot ID             │ The boot ID of the     │
72           │          │                     │ running system,        │
73           │          │                     │ formatted as string.   │
74           │          │                     │ See random(4) for more │
75           │          │                     │ information.           │
76           ├──────────┼─────────────────────┼────────────────────────┤
77           │"%B"      │ Operating system    │ The operating system   │
78           │          │ build ID            │ build identifier of    │
79           │          │                     │ the running system, as │
80           │          │                     │ read from the          │
81           │          │                     │ BUILD_ID= field of     │
82           │          │                     │ /etc/os-release. If    │
83           │          │                     │ not set, resolves to   │
84           │          │                     │ an empty string. See   │
85           │          │                     │ os-release(5) for more │
86           │          │                     │ information.           │
87           ├──────────┼─────────────────────┼────────────────────────┤
88           │"%H"      │ Host name           │ The hostname of the    │
89           │          │                     │ running system.        │
90           ├──────────┼─────────────────────┼────────────────────────┤
91           │"%m"      │ Machine ID          │ The machine ID of the  │
92           │          │                     │ running system,        │
93           │          │                     │ formatted as string.   │
94           │          │                     │ See machine-id(5) for  │
95           │          │                     │ more information.      │
96           ├──────────┼─────────────────────┼────────────────────────┤
97           │"%o"      │ Operating system ID │ The operating system   │
98           │          │                     │ identifier of the      │
99           │          │                     │ running system, as     │
100           │          │                     │ read from the ID=
101           │          │                     │ field of               │
102           │          │                     │ /etc/os-release. See   │
103           │          │                     │ os-release(5) for more │
104           │          │                     │ information.           │
105           ├──────────┼─────────────────────┼────────────────────────┤
106           │"%v"      │ Kernel release      │ Identical to uname -r  
107           │          │                     │ output.                │
108           ├──────────┼─────────────────────┼────────────────────────┤
109           │"%w"      │ Operating system    │ The operating system   │
110           │          │ version ID          │ version identifier of  │
111           │          │                     │ the running system, as │
112           │          │                     │ read from the          │
113           │          │                     │ VERSION_ID= field of   │
114           │          │                     │ /etc/os-release. If    │
115           │          │                     │ not set, resolves to   │
116           │          │                     │ an empty string. See   │
117           │          │                     │ os-release(5) for more │
118           │          │                     │ information.           │
119           ├──────────┼─────────────────────┼────────────────────────┤
120           │"%W"      │ Operating system    │ The operating system   │
121           │          │ variant ID          │ variant identifier of  │
122           │          │                     │ the running system, as │
123           │          │                     │ read from the          │
124           │          │                     │ VARIANT_ID= field of   │
125           │          │                     │ /etc/os-release. If    │
126           │          │                     │ not set, resolves to   │
127           │          │                     │ an empty string. See   │
128           │          │                     │ os-release(5) for more │
129           │          │                     │ information.           │
130           ├──────────┼─────────────────────┼────────────────────────┤
131           │"%%"      │ Single percent sign │ Use "%%" in place of   │
132           │          │                     │ "%" to specify a       │
133           │          │                     │ single percent sign.   │
134           └──────────┴─────────────────────┴────────────────────────┘
135
136       Type=
137           A type of the network service as defined in the section 4.1.2 of
138           RFC 6763[1], e.g.  "_http._tcp".
139
140       Port=
141           An IP port number of the network service.
142
143       Priority=
144           A priority number set in SRV resource records corresponding to the
145           network service.
146
147       Weight=
148           A weight number set in SRV resource records corresponding to the
149           network service.
150
151       TxtText=
152           A whitespace-separated list of arbitrary key/value pairs conveying
153           additional information about the named service in the corresponding
154           TXT resource record, e.g.  "path=/portal/index.html". Keys and
155           values can contain C-style escape sequences which get translated
156           upon reading configuration files.
157
158           This option together with TxtData= may be specified more than once,
159           in which case multiple TXT resource records will be created for the
160           service. If the empty string is assigned to this option, the list
161           is reset and all prior assignments will have no effect.
162
163       TxtData=
164           A whitespace-separated list of arbitrary key/value pairs conveying
165           additional information about the named service in the corresponding
166           TXT resource record where values are base64-encoded string
167           representing any binary data, e.g.
168           "data=YW55IGJpbmFyeSBkYXRhCg==". Keys can contain C-style escape
169           sequences which get translated upon reading configuration files.
170
171           This option together with TxtText= may be specified more than once,
172           in which case multiple TXT resource records will be created for the
173           service. If the empty string is assigned to this option, the list
174           is reset and all prior assignments will have no effect.
175

EXAMPLES

177       Example 1. HTTP service
178
179           # /etc/systemd/dnssd/http.dnssd
180           [Service]
181           Name=%H
182           Type=_http._tcp
183           Port=80
184           TxtText=path=/stats/index.html t=temperature_sensor
185
186       This makes the http server running on the host discoverable in the
187       local network given MulticastDNS is enabled on the network interface.
188
189       Now the utility "resolvectl" should be able to resolve the service to
190       the host's name:
191
192           $ resolvectl service meteo._http._tcp.local
193           meteo._http._tcp.local: meteo.local:80 [priority=0, weight=0]
194                                   169.254.208.106%senp0s21f0u2u4
195                                   fe80::213:3bff:fe49:8aa%senp0s21f0u2u4
196                                   path=/stats/index.html
197                                   t=temperature_sensor
198                                   (meteo/_http._tcp/local)
199
200           -- Information acquired via protocol mDNS/IPv6 in 4.0ms.
201           -- Data is authenticated: yes
202
203       "Avahi" running on a different host in the same local network should
204       see the service as well:
205
206           $ avahi-browse -a -r
207           + enp3s0 IPv6 meteo                                         Web Site             local
208           + enp3s0 IPv4 meteo                                         Web Site             local
209           = enp3s0 IPv6 meteo                                         Web Site             local
210              hostname = [meteo.local]
211              address = [fe80::213:3bff:fe49:8aa]
212              port = [80]
213              txt = ["path=/stats/index.html" "t=temperature_sensor"]
214           = enp3s0 IPv4 meteo                                         Web Site             local
215              hostname = [meteo.local]
216              address = [169.254.208.106]
217              port = [80]
218              txt = ["path=/stats/index.html" "t=temperature_sensor"]
219

SEE ALSO

221       systemd(1), systemd-resolved.service(8), resolvectl(1)
222

NOTES

224        1. RFC 6763
225           https://tools.ietf.org/html/rfc6763
226
227
228
229systemd 246                                                   SYSTEMD.DNSSD(5)
Impressum