-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimistic DNS #2145
Comments
Makes perfect sense, thanks for filing the feature request! |
This was done in AG for Android... I'm astonished that it's not provided in AG Home. |
I am not so sure DnsLibs (the new implementation that replaced dnsproxy) actually supports optimistic DNS, so I copied this FR there as well: AdguardTeam/DnsLibs#83 |
Just in curiosity.
App developers might know that their servers' IPs will not be changed easily. So it's safe for them to implement Optimistic DNS. DNS is a system with an eventual consistency model. Is it safe to modify TTL arbitrarily in this way for all clients? |
Tbh, I doubt it will cause any issues. DNS records TTL does not guarantee an exact precision due to its nature (it's always TTL + latency). |
Updates #2145. Squashed commit of the following: commit 0c15347 Merge: 98bd3b8 ebade2b Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Jul 14 20:44:58 2021 +0300 Merge branch 'master' into 2145-optimistic-cache commit 98bd3b8 Author: Ildar Kamalov <ik@adguard.com> Date: Wed Jul 14 13:12:56 2021 +0300 client: handle optimistic cache commit 0b469b7 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Jul 1 19:01:01 2021 +0300 openapi: fix log of changes commit f1594e7 Merge: a034eb9 e113b27 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Jul 1 18:53:01 2021 +0300 Merge branch 'master' into 2145-optimistic-cache commit a034eb9 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Jun 29 18:45:28 2021 +0300 dnsforward: fix tests commit c72227f Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Jun 29 18:33:12 2021 +0300 openapi: imp docs commit 35fe0d2 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Jun 28 14:19:46 2021 +0300 dnsforward: add optimistic cache
This feature should be added to the |
We'll consider lowering the cache TTL, thanks for the suggestion. As for showing it in the query log, we plan to introduce a cache indicator in the new design, so we're not sure if optimistic cache requires a special treatment there, but we'll think about it. Thanks for testing the feature! I'll close this issue for now. If you have any new suggestions or find bugs, please fill a new issue. |
The TTL of 60 is too high for expired records and I've personally encountered problems when trying to access home servers using ddns. Most websites have static ip so serving expired records with high TTL isn't a big deal but ISPs give dynamic ip to homes which change frequently on router reboots. The purpose of simultaneously refreshing cache when serving expired record as described by the OP is that "if something does break, a simple refresh would fix it". The TTL of 60 defeats the purpose. It should be something very small like 1 or at max 5. |
@ameshkov |
@ainar-g can we maybe simply make it 10 seconds by default? Making it configurable seems too much to me. |
Merge in DNS/dnsproxy from optimistic-ttl to master Updates AdguardTeam/AdGuardHome#2145. Squashed commit of the following: commit 2b0a13c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Mar 9 17:53:13 2022 +0500 proxy: decr optimistic ttl
@JsBergbau, it's now 10 second in the latest edge builds. |
Thank you very much. |
Does this feature make DoT/DoH/DoQ caching more susceptible to poisoning? |
Updates AdguardTeam#2145. Squashed commit of the following: commit 0c15347 Merge: 98bd3b8 ebade2b Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Jul 14 20:44:58 2021 +0300 Merge branch 'master' into 2145-optimistic-cache commit 98bd3b8 Author: Ildar Kamalov <ik@adguard.com> Date: Wed Jul 14 13:12:56 2021 +0300 client: handle optimistic cache commit 0b469b7 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Jul 1 19:01:01 2021 +0300 openapi: fix log of changes commit f1594e7 Merge: a034eb9 e113b27 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Jul 1 18:53:01 2021 +0300 Merge branch 'master' into 2145-optimistic-cache commit a034eb9 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Jun 29 18:45:28 2021 +0300 dnsforward: fix tests commit c72227f Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Jun 29 18:33:12 2021 +0300 openapi: imp docs commit 35fe0d2 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Jun 28 14:19:46 2021 +0300 dnsforward: add optimistic cache
Merge in DNS/adguard-home from 2145-optimistic-ttl to master Updates AdguardTeam#2145. Squashed commit of the following: commit 81e5aba Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Mar 9 18:34:50 2022 +0500 all: upd proxy
Prerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
Problem Description
Optimistic DNS can reduce latency caused by DNS resolution when a client reconnects after a record has expired, which idea from apple in page 13.
Proposed Solution
When the local DNS cache expires, Adguard Home can continue answer with the IP in the local cache results with 1 TTL, while a new DNS query is made to update the cache. If client can still connect to the server by using the old results, then that's great and reduces the time waiting for DNS query. And if not, after a short TTL, the new DNS result can be sent to client and reconnect again.
Additional Information
Also, there is another Go project named Clash support this feature, you can check this pr.
The text was updated successfully, but these errors were encountered: