AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
24.67k stars 1.78k forks source link

NOERROR+NODATA response is not cached #3598

Closed ZeroClover closed 2 years ago

ZeroClover commented 3 years ago

Issue Details

Actual Behavior

According to RFC4074:

Suppose that an authoritative server has an A RR but has no AAAA RR for a hostname. Then, the server should return a response to a query for an AAAA RR of the name with the response code (RCODE) being 0 (indicating no error) and with an empty answer section

In this case, AdGuard Home does not cache responses, even when the minimum cache TTL is set.

Expected Behavior

AdGuard Home follows the same settings as NXDOMAIN to cache NOERROR+NODATA

Screenshots

Screenshot: ![image](https://user-images.githubusercontent.com/13190004/133390676-89618281-7677-4fef-8ce6-a851a2f2b210.png) ![image](https://user-images.githubusercontent.com/13190004/133392290-100e9f6f-91cd-4185-ac58-c1e65ca187d0.png)

Additional Information

This also seems to affect the dnsproxy

ameshkov commented 3 years ago

@ainar-g legit issue, we'll need to get the TTL from the SOA section in this case.

EugeneOne1 commented 2 years ago

@ZeroClover, hello and apologies for a late response. This seems that it has been implemented in #3707. Could you please check it out in any version of AGH since v0.107.0?

EugeneOne1 commented 2 years ago

@ZeroClover, hello again. I'm going to close the issue for now, feel free to reopen it on any problems with the implementation.