On Mon, Oct 05, 2026 at 03:48:37PM +0100, Mechti via Exim-dev wrote:
> Yep; I've tested this patch for some time on a live production server.
> It fixes this CNAME bug and introduces no negative impact so far...
>
> --- a/src/dns.c 2026-08-20 10:39:08.000000000 +0200
> +++ b/src/dns.c 2026-09-17 11:46:26.343957061 +0200
> @@ -1079,7 +1079,7 @@
> if (type_rr.data == NULL) type_rr = *rr;
> if (cname_rr.data != NULL) break;
> }
> - else if (rr->type == T_CNAME)
> + else if (rr->type == T_CNAME && cname_rr.data == NULL)
> cname_rr = *rr;
>
> /* For the first time round this loop, if a CNAME was found, take the fully
The patch picks the first CNAME in the answer, which works as long as
the resolver lists the chain starting from the queried name. That is
the usual order, but nothing has required it so far. In January a
change at Cloudflare's 1.1.1.1 moved CNAMEs after the final records, and
that broke some clients, glibc's getaddrinfo among them. There is now a
draft in dnsop (draft-jabley-dnsop-ordered-answer-section) to make the
order a requirement, but older resolvers won't change.
Since the purpose of fully_qualified_name is to catch the name the
resolver actually queried (after search-list or default-domain
qualification), it might be simpler and more robust to take that name
from the question section of the response, rather than from the owner of
a CNAME or data record. Then the order of records in the answer doesn't
matter at all.
--
Viktor. 🇺🇦 Слава Україні!
--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## [email protected]
## Exim details at https://www.exim.org/
## Please use the Wiki with this list - https://code.exim.org/exim/wiki/wiki