From b0ba5f07d5ab7a151aa83c8417c0a1772b10bee9 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Wed, 11 Sep 2019 11:52:35 +0200 Subject: [PATCH] dnsdist kvs.rst: format code blocks correctly --- pdns/dnsdistdist/docs/reference/kvs.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdns/dnsdistdist/docs/reference/kvs.rst b/pdns/dnsdistdist/docs/reference/kvs.rst index 999c5244f..100e2c4e5 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. -- 2.40.0