New DNS client permanently pins a DNS record received with a TTL of 0, which can happen when querying a caching resolver.
Is there an existing issue for this?
- I have searched the existing issues
Kong version ($ kong version)
3.9.3
Current Behavior
The new DNS client treats a record with a TTL of zero as data to store permanently when it should be used for the current transaction and discarded.
See code snippets in discussion #15000
Expected Behavior
DNS record with TTL=0 should be used for the current transaction and immediately discarded.
RFC 8767 states:
TTL: a 32-bit unsigned integer number of seconds that specifies the duration that the resource record MAY be cached before the source of the information MUST again be consulted. Zero values are interpreted to mean that the RR can only be used for the transaction in progress, and should not be cached.
Steps To Reproduce
Run the new DNS client with resolver_valid_til unset and a caching DNS resolver. The resolver will eventually emit a record with TTL=0 and trigger the behavior.
Anything else?
No response
Source: Kong/kong