From: Peter van Dijk Date: Wed, 11 Sep 2019 09:52:35 +0000 (+0200) Subject: dnsdist kvs.rst: format code blocks correctly X-Git-Tag: dnsdist-1.4.0-rc3~50^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0ba5f07d5ab7a151aa83c8417c0a1772b10bee9;p=thirdparty%2Fpdns.git dnsdist kvs.rst: format code blocks correctly --- diff --git a/pdns/dnsdistdist/docs/reference/kvs.rst b/pdns/dnsdistdist/docs/reference/kvs.rst index 999c5244f3..100e2c4e58 100644 --- a/pdns/dnsdistdist/docs/reference/kvs.rst +++ b/pdns/dnsdistdist/docs/reference/kvs.rst @@ -23,6 +23,8 @@ Then the key used for the lookup can be selected via one of the following functi For example, to do a suffix-based lookup into a LMDB KVS database, the following rule can be used: +.. code-block:: lua + > kvs = newLMDBKVStore('/path/to/lmdb/database', 'database name') > addAction(AllRule(), KeyValueStoreLookupAction(kvs, KeyValueLookupKeySuffix(), 'kvs-suffix-result')) @@ -35,6 +37,8 @@ this would result in the following lookups: Then a match is found for the last key, and the corresponding value is stored into the 'kvs-suffix-result' tag. This tag can now be used in subsequent rules to take an action based on the result of the lookup. +.. code-block:: lua + > addAction(TagRule('kvs-suffix-result', 'this is the value obtained from the lookup'), SpoofAction('2001:db8::1')) If the value found in the LMDB database for the key '\\8powerdns\\3com\\0' was 'this is the value obtained from the lookup', then the query is immediately answered with a AAAA record.