--- source4/dns_server/dns_server.c.orig 2017-07-04 12:05:26.000000000 +0200 +++ source4/dns_server/dns_server.c 2019-10-05 16:44:55.000000000 +0200 @@ -215,13 +215,15 @@ struct dns_process_state *state = tevent_req_data( req, struct dns_process_state); WERROR ret; + uint16_t operation; ret = dns_server_process_query_recv( - subreq, state, + subreq, state, &operation, &state->out_packet.answers, &state->out_packet.ancount, &state->out_packet.nsrecs, &state->out_packet.nscount, &state->out_packet.additional, &state->out_packet.arcount); TALLOC_FREE(subreq); + state->dns_err = operation & DNS_RCODE; if (!W_ERROR_IS_OK(ret)) { state->dns_err = werr_to_dns_err(ret);