Version: DNS Server 2.6.2 (DnsServerApp.dll fileVersion 2.6.2.46322)
Summary
When the Filter AAAA app (Apps/FilterAaaaApp/App.cs) rewrites an AAAA response into a synthetic NODATA answer, it hardcodes the authoritativeAnswer flag to false unconditionally, rather than preserving whatever the original response's flag actually was. This is correct for the common case (filtering AAAA on a recursively-resolved/forwarded answer for a domain this server doesn't host, where AA=0 is the right behavior anyway), but wrong when the server is authoritative for the zone being filtered: e.g. a locally-hosted internal domain with an A record and no AAAA record. In that case the real, correct answer is a confirmed authoritative NODATA, but the app always downgrades it to non-authoritative.
A resolver forwarding to this server (e.g. Unbound with a forward-zone) treats a non-authoritative NODATA as inconclusive rather than a confirmed negative answer, and falls back to normal recursive resolution instead of trusting it, silently defeating the filter for anyone running Technitium behind a forwarding resolver for their own authoritative zones.
Where
PostProcessAsync in App.cs, the response construction at the end of the filtering branch:
return new DnsDatagram(response.Identifier, true, response.OPCODE, false, false,
response.RecursionDesired, response.RecursionAvailable, false, false,
DnsResponseCode.NoError, response.Question, answer, authority) { Tag = response.Tag };
The 4th positional argument (authoritativeAnswer) is a literal false. RecursionDesired/RecursionAvailable a few arguments later are correctly carried over from response. AuthoritativeAnswer should be too.
Reproduction
- Host an authoritative zone in Technitium (e.g.
example.com) with an A record but no AAAA record for some name.
- Enable Filter AAAA with that domain in
filterDomains.
- Query the A record directly: response has
aa set (correct, this server is authoritative).
- Query the AAAA record: response is a clean
NOERROR/NODATA (correct data), but aa is missing, despite this server being authoritative for the zone.
- Point an Unbound
forward-zone at this server for the domain. A queries resolve correctly. AAAA queries, given the non-authoritative NODATA, get treated as inconclusive and fall through to real recursive resolution, returning the domain's real public AAAA records instead of confirming none exist internally.
Expected fix
Replace the literal false with response.AuthoritativeAnswer, so the synthesized response inherits the same authority status the original response already correctly had; false when relaying a recursive/forwarded answer (as now), true when the server is genuinely authoritative for the zone (currently broken).
Workaround
bypassLocalZones: true avoids this for locally-hosted zones by skipping the rewrite entirely when the original response is already authoritative, but that also disables filtering for those zones going forward, including any future host that gets a genuine AAAA record.
Version: DNS Server 2.6.2 (
DnsServerApp.dllfileVersion2.6.2.46322)Summary
When the Filter AAAA app (
Apps/FilterAaaaApp/App.cs) rewrites an AAAA response into a synthetic NODATA answer, it hardcodes theauthoritativeAnswerflag tofalseunconditionally, rather than preserving whatever the original response's flag actually was. This is correct for the common case (filtering AAAA on a recursively-resolved/forwarded answer for a domain this server doesn't host, whereAA=0is the right behavior anyway), but wrong when the server is authoritative for the zone being filtered: e.g. a locally-hosted internal domain with an A record and no AAAA record. In that case the real, correct answer is a confirmed authoritative NODATA, but the app always downgrades it to non-authoritative.A resolver forwarding to this server (e.g. Unbound with a
forward-zone) treats a non-authoritative NODATA as inconclusive rather than a confirmed negative answer, and falls back to normal recursive resolution instead of trusting it, silently defeating the filter for anyone running Technitium behind a forwarding resolver for their own authoritative zones.Where
PostProcessAsyncinApp.cs, the response construction at the end of the filtering branch:The 4th positional argument (
authoritativeAnswer) is a literalfalse.RecursionDesired/RecursionAvailablea few arguments later are correctly carried over fromresponse.AuthoritativeAnswershould be too.Reproduction
example.com) with an A record but no AAAA record for some name.filterDomains.aaset (correct, this server is authoritative).NOERROR/NODATA(correct data), butaais missing, despite this server being authoritative for the zone.forward-zoneat this server for the domain. A queries resolve correctly. AAAA queries, given the non-authoritative NODATA, get treated as inconclusive and fall through to real recursive resolution, returning the domain's real public AAAA records instead of confirming none exist internally.Expected fix
Replace the literal
falsewithresponse.AuthoritativeAnswer, so the synthesized response inherits the same authority status the original response already correctly had;falsewhen relaying a recursive/forwarded answer (as now),truewhen the server is genuinely authoritative for the zone (currently broken).Workaround
bypassLocalZones: trueavoids this for locally-hosted zones by skipping the rewrite entirely when the original response is already authoritative, but that also disables filtering for those zones going forward, including any future host that gets a genuine AAAA record.