Skip to content

Commit 8736dd6

Browse files
reynirhannesm
authored andcommitted
Return NXDomain when require_domain
This seems to be what DNSmasq does.
1 parent 689548a commit 8736dd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mirage/stub/dns_stub_mirage.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ module Make (S : Tcpip.Stack.V4V6) = struct
269269
| None ->
270270
let dn, qtyp = question in
271271
if Domain_name.count_labels dn = 1 && (qtyp = `K (Rr_map.K A) || qtyp = `K (Rr_map.K Aaaa)) then
272-
let data = `Answer (Name_rr_map.empty, Name_rr_map.empty) in
272+
let data = `Rcode_error (Rcode.NXDomain, Opcode.Query, None) in
273273
let reply = build_reply header question proto data in
274274
Lwt.return (Some reply)
275275
else

0 commit comments

Comments
 (0)