I'm writing a DNS resolver and am building a spreadsheet of when a DNS record should be cached, and not be cached... but it's harder than it first looks (to me at least).
Is there consolidated test cases for DNS caching that I can refer to? All the RFCs seem to have many revisions, and the requirements on caching are inconsistent at best. This is further complicated by the re-definitions of the SOA record.
An improperly cached DNS record can mean that I'm poisoning the cache with invalid records.
The most relevant example I can think of is where a fake referral is generated for an NS, A, or MX.
- When should validation of that referral be done?
- How is that referral validated?
- Should I traverse from the root servers again?