Commit 2e5d478
authored
fix(resolver): reply to NOTFQDN queries with a well-formed NXDOMAIN (#2250)
With `fqdnOnly` enabled, a query for a dotless name was answered with a
dns.Msg carrying only an Rcode: NewEmptyResponse called neither SetReply nor
SetRcode, so the message echoed back neither the request id nor the question
section. Conforming clients discard such an answer as an id mismatch and go
on waiting for a reply that never comes, so users saw a timeout instead of
the NXDOMAIN the documentation promises.
Build the answer with NewResponseWithRcode instead, whose SetRcode echoes id
and question, and drop NewEmptyResponse: FQDNOnlyResolver was its only
caller, and every other resolver already replies via SetReply.
The e2e test accepted "any DNS error" as a valid rejection, which is why this
went unnoticed; it now asserts that the client actually receives NXDOMAIN
with its question echoed back.
Claude-Session: https://claude.ai/code/session_01QyEFFhrY3j9QtGzR2wUJr91 parent ff2aae4 commit 2e5d478
4 files changed
Lines changed: 21 additions & 19 deletions
File tree
- e2e
- model
- resolver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
91 | 103 | | |
92 | 104 | | |
93 | 105 | | |
| |||
0 commit comments