NSECRecordContent nrc;
nrc.d_set.insert(QType::RRSIG);
nrc.d_set.insert(QType::NSEC);
- if(sd.qname == begin)
+ if(pdns_iequals(sd.qname, begin))
nrc.d_set.insert(QType::DNSKEY);
DNSResourceRecord rr;
sd.db->getBeforeAndAfterNames(sd.domain_id, auth, target, before, after);
emitNSEC(before, after, target, sd, r, mode);
- if (mode == 2) {
- // wildcard NO-DATA
+ if (mode == 2 || mode == 4) {
+ // wildcard NO-DATA or wildcard denial
before.clear();
- sd.db->getBeforeAndAfterNames(sd.domain_id, auth, wildcard, before, after);
+ string closest(wildcard);
+ if (mode == 4) {
+ (void) chopOff(closest);
+ closest=dotConcat("*", closest);
+ }
+ sd.db->getBeforeAndAfterNames(sd.domain_id, auth, closest, before, after);
emitNSEC(before, after, target, sd, r, mode);
}
-
- if (mode == 4) {
- // this one does wildcard denial, if applicable
- before='.';
- sd.db->getBeforeAndAfterNames(sd.domain_id, auth, auth, before, after);
- emitNSEC(auth, after, auth, sd, r, mode);
- }
-
return;
}
-1 example.com. IN NSEC 86400 double.example.com. NS SOA MX RRSIG NSEC DNSKEY
-1 example.com. IN RRSIG 86400 NSEC 8 2 86400 [expiry] [inception] [keytag] example.com. ...
1 example.com. IN RRSIG 86400 SOA 8 2 100000 [expiry] [inception] [keytag] example.com. ...
1 example.com. IN SOA 86400 ns1.example.com. ahu.example.com. 2000081501 28800 7200 604800 86400
1 outpost.example.com. IN NSEC 86400 semi-external.example.com. A RRSIG NSEC