[GH-ISSUE #1331] CNAME TTL handling is broken when LookupIpStrategy::Ipv4AndIpv6 or LookupIpStrategy::Ipv6thenIpv4 #650

Closed
opened 2026-03-15 23:40:36 +03:00 by kerem · 0 comments
Owner

Originally created by @database64128 on GitHub (Dec 28, 2020).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1331

Describe the bug
When using LookupIpStrategy::Ipv4AndIpv6 or LookupIpStrategy::Ipv6thenIpv4, the resolver will always send a query for the domain name, if the response only has an A record.

To Reproduce
Steps to reproduce the behavior:

  1. Consider "a CNAME b" with a 900s TTL, "b A 1.1.1.1" with a 900s TTL.
  2. Configure the resolver with LookupIpStrategy::Ipv4AndIpv6 or LookupIpStrategy::Ipv6thenIpv4.
  3. Use the resolver to resolve "a".
  4. After the first resolution completed, resolve the same hostname again.
  5. The resolver sends another query for "a". Upon receiving the response "CNAME b", it tries to recursively resolve "b", hits cache and completes the query.

Expected behavior
CNAME TTL is properly handled. The response is cached. No queries are sent before the cache expires.

Version:
Crate: resolver
Version: 57245de

Additional context
Related: #273, #298.

Originally created by @database64128 on GitHub (Dec 28, 2020). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1331 **Describe the bug** When using `LookupIpStrategy::Ipv4AndIpv6` or `LookupIpStrategy::Ipv6thenIpv4`, the resolver will always send a query for the domain name, if the response only has an A record. **To Reproduce** Steps to reproduce the behavior: 1. Consider "a CNAME b" with a 900s TTL, "b A 1.1.1.1" with a 900s TTL. 2. Configure the resolver with `LookupIpStrategy::Ipv4AndIpv6` or `LookupIpStrategy::Ipv6thenIpv4`. 3. Use the resolver to resolve "a". 4. After the first resolution completed, resolve the same hostname again. 5. The resolver sends another query for "a". Upon receiving the response "CNAME b", it tries to recursively resolve "b", hits cache and completes the query. **Expected behavior** CNAME TTL is properly handled. The response is cached. No queries are sent before the cache expires. **Version:** Crate: resolver Version: 57245de **Additional context** Related: #273, #298.
kerem 2026-03-15 23:40:36 +03:00
  • closed this issue
  • added the
    bug
    label
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#650
No description provided.