diff --git a/doc/sphinx/arm/hooks-ddns-tuning.rst b/doc/sphinx/arm/hooks-ddns-tuning.rst new file mode 100644 index 0000000000..6acf02247a --- /dev/null +++ b/doc/sphinx/arm/hooks-ddns-tuning.rst @@ -0,0 +1,64 @@ +.. _hooks-ddns-tuning: + +``ddns_tuning``: Tuning DNS updates +=================================== + +This hook library adds support for fine tuning various DNS update aspects. +Currently is supports procedural hostname generation and an ability to fine +tune which devices should do the DNS update. The DDNS Tuning hook is a premium +feature. + +The library, which was added in Kea 2.1.4, can be loaded in a +similar way to other hook libraries by the ``kea-dhcp4`` and +``kea-dhcp6`` processes. + +.. code-block:: javascript + + { + "hooks-libraries": [ + { + "library": "/usr/local/lib/libdhcp_ddns_tuning.so", + "parameters": { + "hostname-expr": "'host-'+hexstring(pkt4.mac,'-')" + } + } + ] + } + +This hook allows generating hostname procedurally, based on an expression. + +The expression can be defined globally in the hook parameters, using `hostname-expr`. +If defined globally, it will apply to all hosts in all subnets. The expressions can use +all tokens defined in :ref:`classify`. + +It is also possible to define this parameter in a subnet, using user context mechanism. +If defined in on subnet level, the expression applies to specific subnet only. + +.. code-block:: javascript + + "subnet4": [{ + "subnet": "192.0.2.0/24", + "pools": [{ + "pool": "192.0.2.10 - 192.0.2.20", + } ], + + // This is a subnet-specific user context. + "user-context": { + "hostame-expr": "'guest-'+Int8ToText(substring(pkt4.yiaddr, 0,1))+'-' \ + +Int8ToText(substring(pkt4.yiaddr, 1,2))+'-' \ + +Int8ToText(substring(pkt4.yiaddr, 2,3))+'-' \ + +Int8ToText(substring(pkt4.yiaddr, 3,4))", + "last-modified": "2017-09-04 13:32", + "description": "you can put anything you like here", + "phones": [ "x1234", "x2345" ], + "devices-registered": 42, + "billing": false + } + }] + +.. note:: + + Privacy should be taken into consideration when generating a hostname. The hostname is + usually inserted into the DNS, which is a public system. Exposing identifiers that + can be used to track devices, such as MAC address, are usually a very bad idea. + The global expression example used MAC address for simplicity. diff --git a/doc/sphinx/arm/hooks.rst b/doc/sphinx/arm/hooks.rst index 913825cc52..77ea814314 100644 --- a/doc/sphinx/arm/hooks.rst +++ b/doc/sphinx/arm/hooks.rst @@ -3581,6 +3581,7 @@ both the command and the response. .. include:: hooks-host-cache.rst .. include:: hooks-lease-query.rst .. include:: hooks-run-script.rst +.. include:: hooks-ddns-tuning.rst .. _user-context-hooks: diff --git a/doc/sphinx/arm/rst_arm_sources.mk b/doc/sphinx/arm/rst_arm_sources.mk index d1c27f5a07..29a32eea82 100644 --- a/doc/sphinx/arm/rst_arm_sources.mk +++ b/doc/sphinx/arm/rst_arm_sources.mk @@ -24,6 +24,7 @@ rst_arm_sources += arm/hooks-lease-query.rst rst_arm_sources += arm/hooks-radius.rst rst_arm_sources += arm/hooks-run-script.rst rst_arm_sources += arm/hooks-stat-cmds.rst +rst_arm_sources += arm/hooks-ddns-tuning.rst rst_arm_sources += arm/hooks.rst rst_arm_sources += arm/install.rst rst_arm_sources += arm/integrations.rst