AdguardTeam / AdGuardHome

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

Optimistic caching TTL value #5621

Open HellboyPI opened 1 year ago

HellboyPI commented 1 year ago

Prerequisites

Description

What problem are you trying to solve?

The default TTL value in Optimistic caching is 10. TTL of 10 in DNS world is an eternity. 😃

1) If the ip is still valid, no problem. 2) If the ip is not valid, connection issues. Client software will probably timeout in these 10 seconds.

Proposed solution

Ability to manually change/ reduce this value (in AdGuardHome.yaml). Users will change this value based on their network setup.

Or is this option already available? I want to reduce this value to 1-3 seconds. Even with a TTL value of 2 seconds, AdGuard Home will have enough time to refresh the DNS entry. Most DNS responses are <200 ms.

JsBergbau commented 6 months ago

Is there any update on this? The problem is still very relevant.

My solution is just to set the timeout from optimistic cache to 1s. So you gain a little bit speed, but the consqueneces are much less severe when website moved to another ip address.

The feature optimistic DNS cache is great, very innovative and should be tuned therefore that it can use its full potential.

ADV-R commented 6 months ago

Default optimistic cache settings without the ability to change them (serve with TTL of 10 for an unlimited amount of time) make such a great feature unusable.

At best serve-expired-ttl and serve-expired-reply-ttl (as in Unbound) should be implemented.

At least the default settings should be changed to serve with TTL of 0 for no more than 259200 after expiration.