-
Notifications
You must be signed in to change notification settings - Fork 4.3k
DNS Upstream TTL troubles #4735
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
Comments
我记得之前不是有一个最低ttl的吗 |
TTL changes in a rotating manner: 60, 59, ..., 2, 1, 60, 59, ... , 2, 1, 60, ....... If you saw ttl=5, if you try 5 seconds later, you see ttl=60 this time. So the average-interval between requests will be at least 60 seconds, and there is no problem. (Instagram domains ttl is 60 to 1) |
返回真实ttl是为了避免特定场景下因过久的cache导致目标域名解析到了已废弃ip的问题 以前是返回给客户端的ttl永远为600,因此你可能十分钟感受到一次卡顿,把问题掩盖住了 但增加CPU负载我表示不太理解,没遇到过,你有数据吗 在“强制改写ttl”出来之前,你可以用这种办法缓解:
由于你的客户端和服务器之间的连接质量不佳,实际上你应该永远使用这种办法 |
you are right, so the problem is that Xray server does not adjust ttl based on client request, for example when dns ttl in Xray server cache have 5 seconds to expire and client sends dns request to xray server, xray server will send ttl 5 to the client, and client must 5 seconds later resolve the same domain again to get ttl 60 |
或许可以有个当 PC/Phone 向 Xray 内置的 DNS请求 时检查 TTL < 10 |
There is no difference in practice. Even if you don't use xray-core, the ttl bevave in rotatating manner. Xray-core just pass the received ttl. So even you don't use vpn or xray-core, you may received 5 seconds ttl. But this is one time, and the average-interval between requests is at least 60 seconds. /// So Xray-core-dns has no problem and this issue can be closed. |
查询一次DNS并没有很大开销 哪怕ttl全是1也只是让xray变成disableCache 把每次dns请求都转发出去而已 所以我并不觉得这是个问题 顶多是有人希望可以refine一下不太想见到的ttl=1 |
Hello
Some domains like Instagram domains have TTL like 5 seconds, and as after #4526 Xray uses the upstream TTL, it made some Apps like Instagram laggy and the overall Xray client user-experience lower, and also made servers to use more CPU because they must repeatedly resolve domains with low TTL
To fix it we need a min-ttl option to increase TTL when it's lower than N seconds
I know it's possible to use an external DNS resolver for Server, but for Xray Clients we need it
Could you guys help please? @Meo597 @patterniha @Fangliding
Thanks
The text was updated successfully, but these errors were encountered: