diff --git a/lib/ns/query.c b/lib/ns/query.c index 35193b9c17..2bc3fc45e9 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -7757,7 +7757,10 @@ query_respond_any(query_ctx_t *qctx) { } qctx->rpz_st = qctx->client->query.rpz_st; - if (qctx->rpz_st != NULL) { + if (qctx->rpz_st != NULL && + qctx->rpz_st->m.policy != DNS_RPZ_POLICY_MISS && + qctx->rpz_st->m.policy != DNS_RPZ_POLICY_PASSTHRU) + { qctx->rdataset->ttl = ISC_MIN(qctx->rdataset->ttl, qctx->rpz_st->m.ttl);