AdguardTeam / AdGuardHome

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

Persist DNS cache across dnsproxy restarts #3915

Open agneevX opened 2 years ago

agneevX commented 2 years ago

AGH version: 0.107.0-a.213+936a7057

Problem Description

When any of the Save/Apply buttons in Settings -> DNS Settings is hit, dnsproxy is restarted and the built-up cache is lost.

Proposed Solution

Since Optimistic caching is a new feature currently in beta, it should not be reset when dnsproxy restarts. This defeats the purpose of caching if its deleted when I change an upstream server for example.

Alternatives Considered

Additional Information

Zerorigin commented 2 months ago

In most parts of China..., the domain name resolution results for major international services provided by domestic public DNS providers have been poisoned by the GFW.

Service connections to overseas public DNS providers have also been disrupted or blocked to some extent, resulting in packet loss, high latency, or unavailability. Therefore, DNS cache persistence is of great significance to these users.

It greatly optimizes the network experience, prevents cache loss when restarting services, and avoids the lengthy process of re-accumulating caches.