DNS: Use cache for NXDOMAIN (rcode 3 error)#4560
Merged
Conversation
Contributor
Collaborator
|
家用路由器上的dnsmasq不会面临此问题,因为它的upstream就是tcp udp 鉴于xray特有场景,应像isp的递归dns一样,防御nxdomain flood 针对nxdomain应不遵守rfc,强制缓存10或者60秒 过大的值会导致网站管理员遇到困扰不得不重启xray |
Member
|
话说我之前改 DNS 时也注意到了,ray 每多支持一种 DNS 查询方式就是 copy 整份代码,这挺劣质的,有空把它们改为复用吗? |
RPRX
pushed a commit
that referenced
this pull request
Mar 29, 2025
Closed
1 task
maoxikun
added a commit
to maoxikun/Xray-core
that referenced
this pull request
Aug 22, 2025
This reverts commit 1685c61
Collaborator
|
it2konst
pushed a commit
to it2konst/gametunnel-core
that referenced
this pull request
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First, I have to thank @Fangliding for his guidance on #4558 (comment).
I mistakenly think that the problem is related to log, but in fact log is just log and has nothing to do with performance.
in #3784 @Fangliding change the original code
err != errRecordNotFoundtoerr == nil || err == dns_feature.ErrEmptyResponseTo be more accurate.but in android some apps send thousands of requests in a matter of seconds, that return
NXDOMAIN.This causes performance to drop drastically, and many people have complained about this.
So I also added
NXDOMAINto the modes that should usecache.