Hi,
I am running knot-resolver version 2.0.0 and I would like to redirect
(STUB) queries from a subnet to a specific nameserver. For that I
created a view configuration for that subnet (see below). A query
without being in that subnet caches the answer but unfortunately the
cache overrides the answer when doing the same query inside the view.
My configuration file looks like that:
---
modules = {
'hints > iterate',
'policy > hints',
'view < cache'
}
view:addr('${SUBNET}', policy.suffix(policy.STUB('${IP}'),
{todname('${DOMAIN_SUFFIX}')}))
---
Testing procedure:
1) Try to resolve A record being in the special subnet.
$kdig @${KNOT-RESOLVER} A
www.${DOMAIN_SUFFIX}
-> STUB works and answer is correct
2) Try to resolve A record without being in the special subnet.
$kdig @${KNOT-RESOLVER} ${KNOT-RESOLVER}
-> view is not triggerd and answer is correct
3) Try to resolve A record again within the special subnet.
$kdig @${KNOT-RESOLVER} A
www.${DOMAIN_SUFFIX}
-> The answer is satisfied from cache, which is not the right answer.
Is it even possible to do that?
Best wishes,
Sakirnth