[GH-ISSUE #3053] Recursor may follow multiple CNAMEs with the same record name #1121

Open
opened 2026-03-16 01:40:31 +03:00 by kerem · 0 comments
Owner

Originally created by @divergentdave on GitHub (Jun 13, 2025).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/3053

A CNAME record is supposed to be the only record stored at its name, but it is possible for noncompliant servers to return CNAME RRsets containing multiple records. Currently, RecursorDnsHandle::resolve_cnames() will follow each in turn, combining their answers together. We should instead either pick one CNAME to follow, or return an error.

The end-to-end test recursor::cname::scenarios::cname_lookup_limit_test provides an extreme example -- the dnslib server in that test returns 40 CNAMEs in most responses, providing an exponential number of CNAME chains of length 10. This test exercises the MAX_CNAME_LOOKUPS limit. In fact, with default configuration, the MAX_CNAME_LOOKUPS error can only be hit before the recursion_limit error if some CNAME RRsets have more than one record.

Originally created by @divergentdave on GitHub (Jun 13, 2025). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/3053 A CNAME record is supposed to be the only record stored at its name, but it is possible for noncompliant servers to return CNAME RRsets containing multiple records. Currently, `RecursorDnsHandle::resolve_cnames()` will follow each in turn, combining their answers together. We should instead either pick one CNAME to follow, or return an error. The end-to-end test `recursor::cname::scenarios::cname_lookup_limit_test` provides an extreme example -- the dnslib server in that test returns 40 CNAMEs in most responses, providing an exponential number of CNAME chains of length 10. This test exercises the `MAX_CNAME_LOOKUPS` limit. In fact, with default configuration, the `MAX_CNAME_LOOKUPS` error can only be hit before the `recursion_limit` error if some CNAME RRsets have more than one record.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#1121
No description provided.