1SYSTEMD.DNSSD(5) systemd.dnssd SYSTEMD.DNSSD(5)
2
3
4
6 systemd.dnssd - DNS-SD configuration
7
9 network_service.dnssd
10
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
38 turn take precedence over those in /usr/lib/ or /usr/local/lib. Drop-in
39 files under any of these directories take precedence over the main
40 network service file wherever located.
41
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 ┌──────────┬─────────────────────┬────────────────────────┐
56 │Specifier │ 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 │"%A" │ Operating system │ The operating system │
72 │ │ image version │ image version │
73 │ │ │ identifier of the │
74 │ │ │ running system, as │
75 │ │ │ read from the │
76 │ │ │ IMAGE_VERSION= field │
77 │ │ │ of /etc/os-release. If │
78 │ │ │ not set, resolves to │
79 │ │ │ an empty string. See │
80 │ │ │ os-release(5) for more │
81 │ │ │ information. │
82 ├──────────┼─────────────────────┼────────────────────────┤
83 │"%b" │ Boot ID │ The boot ID of the │
84 │ │ │ running system, │
85 │ │ │ formatted as string. │
86 │ │ │ See random(4) for more │
87 │ │ │ information. │
88 ├──────────┼─────────────────────┼────────────────────────┤
89 │"%B" │ Operating system │ The operating system │
90 │ │ build ID │ build identifier of │
91 │ │ │ the running system, as │
92 │ │ │ read from the │
93 │ │ │ BUILD_ID= field of │
94 │ │ │ /etc/os-release. If │
95 │ │ │ not set, resolves to │
96 │ │ │ an empty string. See │
97 │ │ │ os-release(5) for more │
98 │ │ │ information. │
99 ├──────────┼─────────────────────┼────────────────────────┤
100 │"%H" │ Host name │ The hostname of the │
101 │ │ │ running system. │
102 ├──────────┼─────────────────────┼────────────────────────┤
103 │"%m" │ Machine ID │ The machine ID of the │
104 │ │ │ running system, │
105 │ │ │ formatted as string. │
106 │ │ │ See machine-id(5) for │
107 │ │ │ more information. │
108 ├──────────┼─────────────────────┼────────────────────────┤
109 │"%M" │ Operating system │ The operating system │
110 │ │ image identifier │ image identifier of │
111 │ │ │ the running system, as │
112 │ │ │ read from the │
113 │ │ │ IMAGE_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 │"%o" │ Operating system ID │ The operating system │
121 │ │ │ identifier of the │
122 │ │ │ running system, as │
123 │ │ │ read from the ID= │
124 │ │ │ field of │
125 │ │ │ /etc/os-release. See │
126 │ │ │ os-release(5) for more │
127 │ │ │ information. │
128 ├──────────┼─────────────────────┼────────────────────────┤
129 │"%v" │ Kernel release │ Identical to uname -r │
130 │ │ │ output. │
131 ├──────────┼─────────────────────┼────────────────────────┤
132 │"%w" │ Operating system │ The operating system │
133 │ │ version ID │ version identifier of │
134 │ │ │ the running system, as │
135 │ │ │ read from the │
136 │ │ │ VERSION_ID= field of │
137 │ │ │ /etc/os-release. If │
138 │ │ │ not set, resolves to │
139 │ │ │ an empty string. See │
140 │ │ │ os-release(5) for more │
141 │ │ │ information. │
142 ├──────────┼─────────────────────┼────────────────────────┤
143 │"%W" │ Operating system │ The operating system │
144 │ │ variant ID │ variant identifier of │
145 │ │ │ the running system, as │
146 │ │ │ read from the │
147 │ │ │ VARIANT_ID= field of │
148 │ │ │ /etc/os-release. If │
149 │ │ │ not set, resolves to │
150 │ │ │ an empty string. See │
151 │ │ │ os-release(5) for more │
152 │ │ │ information. │
153 ├──────────┼─────────────────────┼────────────────────────┤
154 │"%%" │ Single percent sign │ Use "%%" in place of │
155 │ │ │ "%" to specify a │
156 │ │ │ single percent sign. │
157 └──────────┴─────────────────────┴────────────────────────┘
158
159 Type=
160 A type of the network service as defined in the section 4.1.2 of
161 RFC 6763[1], e.g. "_http._tcp".
162
163 Port=
164 An IP port number of the network service.
165
166 Priority=
167 A priority number set in SRV resource records corresponding to the
168 network service.
169
170 Weight=
171 A weight number set in SRV resource records corresponding to the
172 network service.
173
174 TxtText=
175 A whitespace-separated list of arbitrary key/value pairs conveying
176 additional information about the named service in the corresponding
177 TXT resource record, e.g. "path=/portal/index.html". Keys and
178 values can contain C-style escape sequences which get translated
179 upon reading configuration files.
180
181 This option together with TxtData= may be specified more than once,
182 in which case multiple TXT resource records will be created for the
183 service. If the empty string is assigned to this option, the list
184 is reset and all prior assignments will have no effect.
185
186 TxtData=
187 A whitespace-separated list of arbitrary key/value pairs conveying
188 additional information about the named service in the corresponding
189 TXT resource record where values are base64-encoded string
190 representing any binary data, e.g.
191 "data=YW55IGJpbmFyeSBkYXRhCg==". Keys can contain C-style escape
192 sequences which get translated upon reading configuration files.
193
194 This option together with TxtText= may be specified more than once,
195 in which case multiple TXT resource records will be created for the
196 service. If the empty string is assigned to this option, the list
197 is reset and all prior assignments will have no effect.
198
200 Example 1. HTTP service
201
202 # /etc/systemd/dnssd/http.dnssd
203 [Service]
204 Name=%H
205 Type=_http._tcp
206 Port=80
207 TxtText=path=/stats/index.html t=temperature_sensor
208
209 This makes the http server running on the host discoverable in the
210 local network given MulticastDNS is enabled on the network interface.
211
212 Now the utility "resolvectl" should be able to resolve the service to
213 the host's name:
214
215 $ resolvectl service meteo._http._tcp.local
216 meteo._http._tcp.local: meteo.local:80 [priority=0, weight=0]
217 169.254.208.106%senp0s21f0u2u4
218 fe80::213:3bff:fe49:8aa%senp0s21f0u2u4
219 path=/stats/index.html
220 t=temperature_sensor
221 (meteo/_http._tcp/local)
222
223 -- Information acquired via protocol mDNS/IPv6 in 4.0ms.
224 -- Data is authenticated: yes
225
226 "Avahi" running on a different host in the same local network should
227 see the service as well:
228
229 $ avahi-browse -a -r
230 + enp3s0 IPv6 meteo Web Site local
231 + enp3s0 IPv4 meteo Web Site local
232 = enp3s0 IPv6 meteo Web Site local
233 hostname = [meteo.local]
234 address = [fe80::213:3bff:fe49:8aa]
235 port = [80]
236 txt = ["path=/stats/index.html" "t=temperature_sensor"]
237 = enp3s0 IPv4 meteo Web Site local
238 hostname = [meteo.local]
239 address = [169.254.208.106]
240 port = [80]
241 txt = ["path=/stats/index.html" "t=temperature_sensor"]
242
244 systemd(1), systemd-resolved.service(8), resolvectl(1)
245
247 1. RFC 6763
248 https://tools.ietf.org/html/rfc6763
249
250
251
252systemd 253 SYSTEMD.DNSSD(5)