dnsproxy module sends corrupted responses when the query is satisfied locally
Version: 2.1.0 from master (not sure when this was broken) How to reproduce:
mod-dnsproxy:
- id: default
remote: 1.2.3.4
template:
- id: default
module: mod-dnsproxy/default
zone:
- domain: fakezone
file: "fakezone.zone"
and kdig @127.0.0.1 SOA fakezone
yields an NXDOMAIN from root server + extra bytes at the end (malformed response).
The module doesn't work as advertised because in QPLAN_BEGIN phase, it can't be flagged as "DONE" yet.
Attached patch changes the behaviour so that when the zone for the QNAME can't be found, it is forwarded.
The documentation might need to be updated. If you want to keep the same functionality, then the forwarding phase
must be moved to the later stages of query resolution and checked for MISS
state (like synth records).