Skip to content

Filter AAAA app always sets AA=0 on its synthesized NODATA response, even when the original response was authoritative #2139

Description

@IReclaimer

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

  1. Host an authoritative zone in Technitium (e.g. example.com) with an A record but no AAAA record for some name.
  2. Enable Filter AAAA with that domain in filterDomains.
  3. Query the A record directly: response has aa set (correct, this server is authoritative).
  4. Query the AAAA record: response is a clean NOERROR/NODATA (correct data), but aa is missing, despite this server being authoritative for the zone.
  5. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions