NXDOMAIN responses from servers forwarded to are not being honored #2882
Closed
DL444
started this conversation in
Potential issues
Replies: 1 comment
-
Fixed in a143fb0 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
I'm using the forwarding feature to delegate all DNS queries for a dedicated internal-use domain (that I registered, but for this discussion let's say it's
example.com
) to a group of internal DNS servers. All other queries are being resolved by dnscrypt-proxy over the public Internet.Problem
Since version 2.1.6, NXDOMAIN responses from internal DNS servers to queries for non-existent hosts and subdomains are no longer being honored by dnscrypt-proxy. The names will then be resolved over the Internet, leaking the queries and potentially yielding different results.
Reproduction
10.0.0.1
)10.0.0.2
)10.0.0.3
)example.com
and define no records.10.0.0.1
).nslookup
to query for a hostname that exists on the Internet, but not on the internal DNS server. For example,A www.example.com
.Analysis
The issue was introduced by eda26b4 where
$DHCP
and$BOOTSTRAP
keywords were added. Specifically at plugin_forward.go:327:dns.RcodeNameError
was designated as one of the cases where the responses from forwarded DNS servers are discarded. In my opinion NXDOMAIN responses should NOT be discarded since they represent deterministic and authoritative answers.Additionally, I believe the entire concept of post-factum resolution of queries matching forwarding rules over the Internet is questionable. It leaks internal queries to the external world, and breaks the documented promise that "suffix-matching is always done".
Proposed Fix
Minimally:
Or more systematically, prevent queries matching forwarding rules from being subsequently resolved over the Internet. Instead, return whatever responses or errors the servers forwarded to might yield.
Beta Was this translation helpful? Give feedback.
All reactions