Skip to content

Commit 0858fe7

Browse files
authored
Merge pull request #1561 from abukharov/feature/dhcp-ddns
dhcp-server: ddns: T6773: DDNS configuration documentation
2 parents 2b25c16 + a50a478 commit 0858fe7

File tree

1 file changed

+195
-14
lines changed

1 file changed

+195
-14
lines changed

docs/configuration/service/dhcp-server.rst

+195-14
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ Configuration
4949
Inform client that the DNS server can be found at `<address>`.
5050

5151
This is the configuration parameter for the entire shared network definition.
52-
All subnets will inherit this configuration item if not specified locally.
52+
All subnets will inherit this configuration item if not specified locally.
5353
Multiple DNS servers can be defined.
5454

55-
.. cfgcmd:: set service dhcp-server shared-network-name <name> option
55+
.. cfgcmd:: set service dhcp-server shared-network-name <name> option
5656
vendor-option <option-name>
5757

58-
This configuration parameter lets you specify a vendor-option for the
59-
entire shared network definition. All subnets will inherit this
60-
configuration item if not specified locally. An example for Ubiquiti is
58+
This configuration parameter lets you specify a vendor-option for the
59+
entire shared network definition. All subnets will inherit this
60+
configuration item if not specified locally. An example for Ubiquiti is
6161
shown below:
6262

6363
**Example:**
@@ -66,14 +66,14 @@ Pass address of Unifi controller at ``172.16.100.1`` to all clients of ``NET1``
6666

6767
.. code-block:: none
6868
69-
set service dhcp-server shared-network-name 'NET1' option vendor-option
69+
set service dhcp-server shared-network-name 'NET1' option vendor-option
7070
ubiquiti '172.16.100.1'
7171
7272
.. cfgcmd:: set service dhcp-server listen-address <address>
7373

74-
This configuration parameter lets the DHCP server to listen for DHCP
75-
requests sent to the specified address, it is only realistically useful for
76-
a server whose only clients are reached via unicasts, such as via DHCP relay
74+
This configuration parameter lets the DHCP server to listen for DHCP
75+
requests sent to the specified address, it is only realistically useful for
76+
a server whose only clients are reached via unicasts, such as via DHCP relay
7777
agents.
7878

7979
Individual Client Subnet
@@ -148,24 +148,205 @@ Individual Client Subnet
148148
request where no full FQDN is passed. This option can be given multiple times
149149
if you need multiple search domains (DHCP Option 119).
150150

151-
.. cfgcmd:: set service dhcp-server shared-network-name <name> subnet <subnet>
151+
.. cfgcmd:: set service dhcp-server shared-network-name <name> subnet <subnet>
152152
option vendor-option <option-name>
153153

154154
This configuration parameter lets you specify a vendor-option for the
155-
subnet specified within the shared network definition. An example for
155+
subnet specified within the shared network definition. An example for
156156
Ubiquiti is shown below:
157157

158158
**Example:**
159159

160-
Create ``172.18.201.0/24`` as a subnet within ``NET1`` and pass address of
160+
Create ``172.18.201.0/24`` as a subnet within ``NET1`` and pass address of
161161
Unifi controller at ``172.16.100.1`` to clients of that subnet.
162162

163163
.. code-block:: none
164164
165-
set service dhcp-server shared-network-name 'NET1' subnet
165+
set service dhcp-server shared-network-name 'NET1' subnet
166166
'172.18.201.0/24' option vendor-option ubiquiti '172.16.100.1'
167167
168168
169+
Dynamic DNS Update (RFC 2136)
170+
-----------------------------
171+
172+
VyOS DHCP service supports RFC-2136 DDNS protocol. Based on DHCP lease change
173+
events, DHCP server generates DDNS update requests (defines as NameChangeRequests
174+
or NCRs) and posts them to a compliant DNS server, that will update its name
175+
database accordingly.
176+
177+
VyOS built-in DNS Forwarder does not support DDNS, you will need an external DNS
178+
server with RFC-2136 DDNS support.
179+
180+
.. cfgcmd:: set service dhcp-server dynamic-dns-update
181+
182+
Enables DDNS globally.
183+
184+
**Behavioral settings**
185+
186+
These settings can be configured on the global level and overridden on the scope
187+
level, i.e. for individual shared networks or subnets. See examples below.
188+
189+
.. cfgcmd:: set service dhcp-server dynamic-dns-update send-updates [ enable
190+
| disable ]
191+
192+
If set to ``enable`` on global level, updates for all scopes will be enabled,
193+
except if explicitly set to ``disable`` on the scope level. If set to ``disable``,
194+
updates will only be sent for scopes, where ``send-updates`` is explicity
195+
set to ``enable``.
196+
197+
This model is followed for a few behavioral settings below: if the option is
198+
not set, the setting is inherited from the parent scope. You can override the
199+
parent scope setting by setting the option explicitly.
200+
201+
.. cfgcmd:: set service dhcp-server dynamic-dns-update override-no-update [ enable
202+
| disable ]
203+
204+
VyOS will ignore client request not to update DNS records and send DDNS
205+
update requests regardless.
206+
207+
.. cfgcmd:: set service dhcp-server dynamic-dns-update override-client-update [ enable
208+
| disable ]
209+
210+
VyOS will override client DDNS request settings and always update both
211+
forward and reverse DNS records.
212+
213+
.. cfgcmd:: set service dhcp-server dynamic-dns-update update-on-renew [ enable
214+
| disable ]
215+
216+
Issue DDNS update requests on DHCP lease renew. In busy networks this may
217+
generate a lot of traffic.
218+
219+
.. cfgcmd:: set service dhcp-server dynamic-dns-update conflict-resolution [ enable
220+
| disable ]
221+
222+
Use RFC-4703 conflict resolution. This algorithm helps in situation when
223+
multiple clients reserve same IP addresses or advertise identical hostnames.
224+
Should be used in most situations.
225+
226+
.. cfgcmd:: set service dhcp-server dynamic-dns-update replace-client-name [ never
227+
| always | when-present | when-not-present ]
228+
229+
* **never**: use the name sent by the client. If the client didn't provide any,
230+
do not generate one. This is the default behavior
231+
232+
* **always**: always generate a name for the client
233+
234+
* **when-present**: replace the name the client sent with a generated one, if
235+
the client didn't send any, do not generate one
236+
237+
* **when-not-present**: use the name sent by the client. If the client didn't
238+
send any, generate one for the client
239+
240+
The names are generated using ``generated-prefix``, ``qualifying-suffix`` and the
241+
client's IP address string.
242+
243+
.. cfgcmd:: set service dhcp-server dynamic-dns-update generated-prefix <prefix>
244+
245+
Prefix used in client name generation.
246+
247+
.. cfgcmd:: set service dhcp-server dynamic-dns-update qualifying-suffix <suffix>
248+
249+
DNS suffix used in client name generation.
250+
251+
.. cfgcmd:: set service dhcp-server dynamic-dns-update ttl-percent <0-100>
252+
253+
TTL of the DNS record as a percentage of the DHCP lease time.
254+
255+
.. cfgcmd:: set service dhcp-server dynamic-dns-update hostname-char-set
256+
<character string>
257+
258+
Characters, that are considered invalid in the client name. They will be replaced
259+
with ``hostname-char-replacement`` string.
260+
261+
.. cfgcmd:: set service dhcp-server dynamic-dns-update hostname-char-replacement
262+
<character string>
263+
264+
Replacement string for the invalid characters defined by ``hostname-char-set``.
265+
266+
**TSIG keys definition**
267+
268+
This is the global list of TSIG keys for DDNS updates. They need to be specified by
269+
the name in the DNS domain definitions.
270+
271+
.. cfgcmd:: set service dhcp-server dynamic-dns-update tsig-key <key-name>
272+
algorithm <algorithm>
273+
274+
Sets the algorithm for the TSIG key. Supported algorithms are ``hmac-md5``,
275+
``hmac-sha1``, ``hmac-sha224``, ``hmac-sha256``, ``hmac-sha384``, ``hmac-sha512``
276+
277+
.. cfgcmd:: set service dhcp-server dynamic-dns-update tsig-key <key-name>
278+
secret <key-secret>
279+
280+
base64-encoded TSIG key secret value
281+
282+
**DNS domains definition**
283+
284+
This is global configuration of DNS servers for the updatable forward and reverse
285+
DNS domains. For every domain multiple DNS servers can be specified.
286+
287+
.. cfgcmd:: set service dhcp-server dynamic-dns-update [forward|reverse]-domain
288+
<domain-name> key-name <tsig-key-name>
289+
290+
TSIG key used for the domain.
291+
292+
.. cfgcmd:: set service dhcp-server dynamic-dns-update [forward|reverse]-domain
293+
<domain-name> dns-server <number> address <ip-address>
294+
295+
IP address of the DNS server.
296+
297+
.. cfgcmd:: set service dhcp-server dynamic-dns-update [forward|reverse]-domain
298+
<domain-name> dns-server <number> port <port>
299+
300+
UDP port of the DNS server. ``53`` is the default.
301+
302+
**Example:**
303+
304+
Global configuration you will most likely want:
305+
306+
.. code-block:: none
307+
308+
set service dhcp-server dynamic-dns-update send-updates enable
309+
set service dhcp-server dynamic-dns-update conflict-resolution enable
310+
311+
Override the above configuration for a shared network NET1:
312+
313+
.. code-block:: none
314+
315+
set service dhcp-server shared-network-name 'NET1' dynamic-dns-update replace-client-name when-not-present
316+
set service dhcp-server shared-network-name 'NET1' dynamic-dns-update generated-prefix ip
317+
set service dhcp-server shared-network-name 'NET1' dynamic-dns-update qualifying-suffix mybigdomain.net
318+
319+
And in a subnet within the same shared network:
320+
321+
.. code-block:: none
322+
323+
set service dhcp-server shared-network-name 'NET1' subnet '172.18.201.0/24' dynamic-dns-update qualifying-suffix mydomain.net
324+
325+
Configure TSIG keys:
326+
327+
.. code-block:: none
328+
329+
set service dhcp-server dynamic-dns-update tsig-key mydomain-net algorithm hmac-sha256
330+
set service dhcp-server dynamic-dns-update tsig-key mydomain-net secret eWF5YW15bGl0dGxla2V5IQ==
331+
set service dhcp-server dynamic-dns-update tsig-key reverse-172-18-201 algorithm hmac-sha256
332+
set service dhcp-server dynamic-dns-update tsig-key reverse-172-18-201 secret eWF5YW15YW5vdGhlcmxpdHRsZWtleSE=
333+
334+
Configure DDNS domains:
335+
336+
.. code-block:: none
337+
338+
set service dhcp-server dynamic-dns-update forward-domain mydomain.net key-name mydomain-net
339+
set service dhcp-server dynamic-dns-update forward-domain mydomain.net dns-server 1 address '172.18.0.254'
340+
set service dhcp-server dynamic-dns-update forward-domain mydomain.net dns-server 1 port 1053
341+
set service dhcp-server dynamic-dns-update forward-domain mydomain.net dns-server 2 address '192.168.124.254'
342+
set service dhcp-server dynamic-dns-update forward-domain mydomain.net dns-server 2 port 53
343+
set service dhcp-server dynamic-dns-update forward-domain 201.18.172.in-addr.arpa key-name reverse-172-18-201
344+
set service dhcp-server dynamic-dns-update reverse-domain 201.18.172.in-addr.arpa dns-server 1 address '172.18.0.254'
345+
set service dhcp-server dynamic-dns-update reverse-domain 201.18.172.in-addr.arpa dns-server 1 port 1053
346+
set service dhcp-server dynamic-dns-update reverse-domain 201.18.172.in-addr.arpa dns-server 2 address '192.168.124.254'
347+
set service dhcp-server dynamic-dns-update reverse-domain 201.18.172.in-addr.arpa dns-server 2 port 53
348+
349+
169350
High Availability
170351
-----------------
171352

@@ -645,7 +826,7 @@ used:
645826

646827

647828
.. cfgcmd:: set service dhcpv6-server shared-network-name <name> subnet
648-
<prefix> prefix-delegation prefix <pd-prefix> excluded-prefix-length <length>
829+
<prefix> prefix-delegation prefix <pd-prefix> excluded-prefix-length <length>
649830

650831
Define lenght of exclude prefix in `<pd-prefix>`.
651832

0 commit comments

Comments
 (0)