From: Tomas Krizek Date: Fri, 14 Aug 2020 11:47:17 +0000 (+0200) Subject: modules/policy: fix typo and reformat example X-Git-Tag: v5.1.3~11^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aca89898322f240eb5c46715a1cc03b608e0c733;p=thirdparty%2Fknot-resolver.git modules/policy: fix typo and reformat example --- diff --git a/modules/policy/README.rst b/modules/policy/README.rst index 2c8e4b20a..9e52f2e25 100644 --- a/modules/policy/README.rst +++ b/modules/policy/README.rst @@ -151,7 +151,7 @@ Following actions stop the policy matching on the query, i.e. other rules are no Overwrite Resource Records in responses with specified values. * type - - RR type to be replaced, e.g. ``[kres.type.A]`` or `numberic value `_. + - RR type to be replaced, e.g. ``[kres.type.A]`` or `numeric value `_. * rdata - RR data in DNS wire format, i.e. binary form specific for given RR type. Set of multiple RRs can be specified as table ``{ rdata1, rdata2, ... }``. Use helper function :func:`kres.str2ip` to generate wire format for A and AAAA records. * ttl @@ -169,13 +169,15 @@ Following actions stop the policy matching on the query, i.e. other rules are no -- policy to change IPv4 address and TTL for example.com policy.add( policy.suffix( - policy.ANSWER({ [kres.type.A] = { rdata=kres.str2ip('192.0.2.7'), ttl=300 } }), - { todname('example.com') })) + policy.ANSWER( + { [kres.type.A] = { rdata=kres.str2ip('192.0.2.7'), ttl=300 } } + ), { todname('example.com') })) -- policy to generate two TXT records (specified in binary format) for example.net policy.add( policy.suffix( - policy.ANSWER({ [kres.type.TXT] = { rdata={'\005first', '\006second'}, ttl=5 } }), - { todname('example.net') })) + policy.ANSWER( + { [kres.type.TXT] = { rdata={'\005first', '\006second'}, ttl=5 } } + ), { todname('example.net') })) More complex non-chain actions are described in their own chapters, namely: