diff --git a/lib/resolve.c b/lib/resolve.c
index d974452f8d924ef7ea6955a900e7fd72e77ca26c..ace257e2edf52a7066472fe7c8812542d08ff4cd 100644
--- a/lib/resolve.c
+++ b/lib/resolve.c
@@ -273,7 +273,8 @@ static int edns_create(knot_pkt_t *pkt, knot_pkt_t *template, struct kr_request
 	pkt->opt_rr = knot_rrset_copy(req->ctx->opt_rr, &pkt->mm);
 	size_t wire_size = knot_edns_wire_size(pkt->opt_rr);
 #if defined(ENABLE_COOKIES)
-	if (req->ctx->cookie_ctx.clnt.enabled) {
+	if (req->ctx->cookie_ctx.clnt.enabled ||
+	    req->ctx->cookie_ctx.srvr.enabled) {
 		wire_size += KR_COOKIE_OPT_MAX_LEN;
 	}
 #endif /* defined(ENABLE_COOKIES) */