Skip to content

DNS: Add new nonIPQuery "reject"#4824

Merged
yuhan6665 merged 1 commit intomainfrom
dns-reject
Jun 23, 2025
Merged

DNS: Add new nonIPQuery "reject"#4824
yuhan6665 merged 1 commit intomainfrom
dns-reject

Conversation

@Fangliding
Copy link
Member

close #4819
Windows上的nslookup也会卡(因为ptr查询)

@yuhan6665
Copy link
Member

感谢佬!感觉这块的逻辑有点奇怪 不过好像没有更简单的办法先这样吧

@yuhan6665 yuhan6665 merged commit 38ed2cc into main Jun 23, 2025
78 checks passed
@stonegr
Copy link

stonegr commented Jun 23, 2025

good, thanks

@RPRX
Copy link
Member

RPRX commented Jun 23, 2025

我感觉把这个设为 default 更好?

@Meo597
Copy link
Collaborator

Meo597 commented Jun 27, 2025

现代浏览器还会发送 https 查询 rfc9460
drop 其实并不算明智选择
你是否考虑让非 a/aaaa 查询也走 dns 模块,但不缓存?
这样可以策略选路,看起来更完美

patterniha pushed a commit to patterniha/Xray-core that referenced this pull request Jun 28, 2025
@jys1670
Copy link

jys1670 commented Jul 16, 2025

I have tried xray-core (commit 1976d02) with this feature.
After a day or so panic occurred:

Jul 16 16:55:11 server xray-start[2436]: panic: Name: name is not in canonical format (it must end with a .)
Jul 16 16:55:11 server xray-start[2436]: goroutine 554783 [running]:
Jul 16 16:55:11 server xray-start[2436]: github.com/xtls/xray-core/common.Must(...)
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/common/common.go:21
Jul 16 16:55:11 server xray-start[2436]: github.com/xtls/xray-core/proxy/dns.(*Handler).rejectNonIPQuery(0x80b1101602c44058?, 0xca00, 0x0, {0x0, 0x0}, {0x166cca0, 0xc001dd2120})
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/proxy/dns/dns.go:341 +0x417
Jul 16 16:55:11 server xray-start[2436]: created by github.com/xtls/xray-core/proxy/dns.(*Handler).Process.func2 in goroutine 553821
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/proxy/dns/dns.go:206 +0x4ab
Jul 16 16:55:11 server xray-start[2436]: panic: Name: name is not in canonical format (it must end with a .)
Jul 16 16:55:11 server xray-start[2436]: goroutine 554782 [running]:
Jul 16 16:55:11 server xray-start[2436]: github.com/xtls/xray-core/common.Must(...)
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/common/common.go:21
Jul 16 16:55:11 server xray-start[2436]: github.com/xtls/xray-core/proxy/dns.(*Handler).rejectNonIPQuery(0x0?, 0xca00, 0x0, {0x0, 0x0}, {0x166cca0, 0xc001dd2120})
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/proxy/dns/dns.go:341 +0x417
Jul 16 16:55:11 server xray-start[2436]: created by github.com/xtls/xray-core/proxy/dns.(*Handler).Process.func2 in goroutine 553821
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/proxy/dns/dns.go:206 +0x4ab

I wasn't able to reproduce problem (server has no logs and many users, no idea what triggered this)
@Fangliding friendly ping, since there is a chance that panic message contains enough info to understand what happened

@Fangliding
Copy link
Member Author

I have tried xray-core (commit 1976d02) with this feature. After a day or so panic occurred:

Jul 16 16:55:11 server xray-start[2436]: panic: Name: name is not in canonical format (it must end with a .)
Jul 16 16:55:11 server xray-start[2436]: goroutine 554783 [running]:
Jul 16 16:55:11 server xray-start[2436]: github.com/xtls/xray-core/common.Must(...)
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/common/common.go:21
Jul 16 16:55:11 server xray-start[2436]: github.com/xtls/xray-core/proxy/dns.(*Handler).rejectNonIPQuery(0x80b1101602c44058?, 0xca00, 0x0, {0x0, 0x0}, {0x166cca0, 0xc001dd2120})
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/proxy/dns/dns.go:341 +0x417
Jul 16 16:55:11 server xray-start[2436]: created by github.com/xtls/xray-core/proxy/dns.(*Handler).Process.func2 in goroutine 553821
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/proxy/dns/dns.go:206 +0x4ab
Jul 16 16:55:11 server xray-start[2436]: panic: Name: name is not in canonical format (it must end with a .)
Jul 16 16:55:11 server xray-start[2436]: goroutine 554782 [running]:
Jul 16 16:55:11 server xray-start[2436]: github.com/xtls/xray-core/common.Must(...)
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/common/common.go:21
Jul 16 16:55:11 server xray-start[2436]: github.com/xtls/xray-core/proxy/dns.(*Handler).rejectNonIPQuery(0x0?, 0xca00, 0x0, {0x0, 0x0}, {0x166cca0, 0xc001dd2120})
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/proxy/dns/dns.go:341 +0x417
Jul 16 16:55:11 server xray-start[2436]: created by github.com/xtls/xray-core/proxy/dns.(*Handler).Process.func2 in goroutine 553821
Jul 16 16:55:11 server xray-start[2436]:         github.com/xtls/xray-core/proxy/dns/dns.go:206 +0x4ab

I wasn't able to reproduce problem (server has no logs and many users, no idea what triggered this) @Fangliding friendly ping, since there is a chance that panic message contains enough info to understand what happened

Fix in #4903 thanks

maoxikun pushed a commit to maoxikun/Xray-core that referenced this pull request Aug 23, 2025
maoxikun pushed a commit to maoxikun/Xray-core that referenced this pull request Aug 23, 2025
it2konst pushed a commit to it2konst/gametunnel-core that referenced this pull request Mar 1, 2026
it2konst pushed a commit to it2konst/gametunnel-core that referenced this pull request Mar 1, 2026
drovosek229 pushed a commit to drovosek229/Xray-core that referenced this pull request Mar 16, 2026
drovosek229 pushed a commit to drovosek229/Xray-core that referenced this pull request Mar 16, 2026
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.

xray透明代理,ios请求缓慢,非a,aaaa的dns请求是否考虑立即reject而不是drop

6 participants