Skip to content

Conversation

patterniha
Copy link
Collaborator

@patterniha patterniha commented Mar 21, 2025

The timeout for each dns is fixed and is 4 seconds.

For some types of dns like doh+fragment, this value may not be enough, but for some other types of dns like udp(freedom), it is too much!

Also, if we want to use fallback, this value is too much. suppose, for example, we have two fallbacks other than the main dns, so it takes 8 seconds to use the second fallback !!!

So the user should be able to decrease or increase this timeout.

@patterniha
Copy link
Collaborator Author

patterniha commented Mar 21, 2025

also, i want to use government-run DNS "shecan", for all domains unless the domain is blocked, to bypass "sanctioned-websites" in telegram version of Serverless-for-Iran.

if the domain is blocked, 2 things can happen:

  1. "shecan" return 10.10.34.34-36 spoofed-IP.
  2. Do not return anything

So if either of these happens, i should use another non-filter dns.

because "shecan" is a domestic service i think even 1-2 seconds timeout is too much, but now we have to wait 4 seconds !!!

@RPRX
Copy link
Member

RPRX commented Mar 21, 2025

毫秒为单位的都加上 Ms 吧,比如 timeoutMs

大致看了一下好像只有 REALITY 那个 maxTimeDiff 没加 Ms,等会儿给它 break 了

@RPRX
Copy link
Member

RPRX commented Mar 21, 2025

顺便 rebase 一下

@patterniha
Copy link
Collaborator Author

毫秒为单位的都加上 Ms 吧,比如 timeoutMs

大致看了一下好像只有 REALITY 那个 maxTimeDiff 没加 Ms,等会儿给它 break 了

done.

@RPRX
Copy link
Member

RPRX commented Mar 21, 2025

基于 86a225c rebase 一下

@patterniha patterniha closed this Mar 21, 2025
@RPRX
Copy link
Member

RPRX commented Mar 21, 2025

你可以 push commits 后 reopen 这个 PR

@patterniha patterniha reopened this Mar 21, 2025
@patterniha
Copy link
Collaborator Author

You can push commits and reopen this PR

done.

@RPRX RPRX changed the title DNS: Add timeout for DnsServerObject DNS: Add timeoutMs for DnsServerObject Mar 21, 2025
@RPRX RPRX merged commit 1067171 into XTLS:main Mar 21, 2025
70 checks passed
maoxikun added a commit to maoxikun/Xray-core that referenced this pull request Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants