diff --git a/src/lib/ares_send.c b/src/lib/ares_send.c index 64ff7edd..ac81599e 100644 --- a/src/lib/ares_send.c +++ b/src/lib/ares_send.c @@ -150,6 +150,11 @@ ares_status_t ares_send_nolock(ares_channel_t *channel, /* Duplicate Query */ status = ares_dns_record_duplicate_ex(&query->query, dnsrec); if (status != ARES_SUCCESS) { + /* Sometimes we might get a EBADRESP response from duplicate due to + * the way it works (write and parse), rewrite it to EBADQUERY. */ + if (status == ARES_EBADRESP) { + status = ARES_EBADQUERY; + } ares_free(query); callback(arg, status, 0, NULL); return status;