From: Matti Hiljanen Date: Mon, 7 Dec 2020 11:53:25 +0000 (+0200) Subject: dnsdist: document setACLFromFile() X-Git-Tag: rec-4.5.0-alpha1~78^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9822%2Fhead;p=thirdparty%2Fpdns.git dnsdist: document setACLFromFile() --- diff --git a/pdns/dnsdistdist/docs/advanced/acl.rst b/pdns/dnsdistdist/docs/advanced/acl.rst index 806243d018..5b4910295f 100644 --- a/pdns/dnsdistdist/docs/advanced/acl.rst +++ b/pdns/dnsdistdist/docs/advanced/acl.rst @@ -66,3 +66,9 @@ dnsdist also has the :func:`setACL` function that accepts a list of netmasks and setACL({'192.0.2.0/25', '2001:db8:15::bea/64'}) + +To set the ACL from a file containing a list of netmasks, use :func:`setACLFromFile`: + +.. code-block:: lua + setACLFromFile('/etc/dnsdist/query.acl') + diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index a196f3905f..973e6c3a4f 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -420,6 +420,14 @@ Access Control Lists :param {str} netmasks: A table of CIDR netmask, e.g. ``{"192.0.2.0/24", "2001:DB8:14::/56"}``. Without a subnetmask, only the specific address is allowed. +.. function:: setACLFromFile(fname) + + .. versionadded:: 1.6.0 + + Reset the ACL to the list of netmasks from the given file. See :ref:`ACL` for more information. + + :param str fname: The path to a file containing a list of netmasks. Empty lines or lines starting with "#" are ignored. + .. function:: showACL() Print a list of all netmasks allowed to send queries over UDP, TCP, DNS over TLS and DNS over HTTPS. See :ref:`ACL` for more information.