Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
dnsdist: Add a KeyValueStoreLookup action based on CDB or LMDB #8139
A lookup into a key value store can be done via the
The first step is to get a
Then the key used for the lookup can be selected via one of the following functions:
For example, to do a suffix-based lookup into a LMDB KVS database, the following rule can be used:
For a query whose qname is "sub.domain.powerdns.com.", and for which only the "\8powerdns\3com\0" key exists in the database, 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.
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.
It would be nice to limit the depth of the KeyValueLookupKeySuffix match.
Matching on wire format names makes debugging harder. It would be nice if this was optional. A flag so that KeyValueLookupKeySuffix::getKeys could use toString() instead of toDNSString().
Thanks for the feedback!
That makes complete sense, I'll likely add that soon.
Agreed, the reason I used wire format was to remove the ambiguity between something like