while(B.get(rr)) {
if(rr.dr.d_type == QType::LUA) {
auto rec=getRR<LUARecordContent>(rr.dr);
- if(rec->d_type != QType::CNAME && rec->d_type != p->qtype.getCode())
- continue;
-
- auto recvec=luaSynth(rec->getCode(), target, sd.qname, sd.domain_id, p->getRemote(), p->getRealRemote(), rec->d_type);
- if(!recvec.empty()) {
- for(const auto& r : recvec) {
- rr.dr.d_type = rec->d_type; // might be CNAME
- rr.dr.d_content = r;
- rr.scopeMask = 32;
- rrset.push_back(rr);
+ if(rec->d_type == QType::CNAME || rec->d_type == p->qtype.getCode()) {
+ noCache=true;
+ auto recvec=luaSynth(rec->getCode(), target, sd.qname, sd.domain_id, p->getRemote(), p->getRealRemote(), rec->d_type);
+ if(!recvec.empty()) {
+
+ for(const auto& r : recvec) {
+ rr.dr.d_type = rec->d_type; // might be CNAME
+ rr.dr.d_content = r;
+ rr.scopeMask = 32;
+ rrset.push_back(rr);
+ }
+ if(rec->d_type == QType::CNAME && p->qtype.getCode() != QType::CNAME)
+ weRedirected = 1;
+ else
+ weDone = 1;
}
- if(rec->d_type == QType::CNAME && p->qtype.getCode() != QType::CNAME)
- weRedirected = 1;
- else
- weDone = 1;
}
}
//cerr<<"got content: ["<<rr.content<<"]"<<endl;
else if(weDone) {
bool haveRecords = false;
for(const auto& loopRR: rrset) {
+ if(loopRR.dr.d_type == QType::LUA)
+ continue;
+
if((p->qtype.getCode() == QType::ANY || loopRR.dr.d_type == p->qtype.getCode()) && loopRR.dr.d_type && loopRR.dr.d_type != QType::ALIAS && loopRR.auth) {
r->addRecord(loopRR);
haveRecords = true;