}
if (!SyncRes::s_nopacketcache && !variableAnswer && !sr.wasVariable()) {
const auto& hdr = pw.getHeader();
- if (hdr->ancount == 0 && hdr->rcode != RCode::NoError) {
+ if (hdr->ancount == 0 && hdr->rcode != RCode::NoError && hdr->rcode != RCode::NXDomain) {
minTTL = min(minTTL, SyncRes::s_packetcacheservfailttl);
}
minTTL = min(minTTL, SyncRes::s_packetcachettl);
- Default: 60
Maximum number of seconds to cache a 'server failure' and other answers signalling an error in the packet cache.
+Before version 4.6.0 only ``ServFail`` answers were considered an error. Starting with 4.6.0, any answer without answers records and rcode other than ``NoError`` and ``NXDomain`` are considered errors.
.. versionchanged:: 4.0.0