-
Notifications
You must be signed in to change notification settings - Fork 3.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
无效DNS结果被缓存, 只能重启xray进程 #1231
Labels
bug
Something isn't working
Comments
感谢你的详细分析 待修复 |
怪不得更新后就断断续续,
|
你们都是直接用xray代理dns的吗。我独立使用unbound dns缓存服务器会被影响吗 |
不只是nameserver_udp.go里有这个问题。所有的nameserver_tcp/quic/doh.go里都有这个问题。
yuhan6665 ***@***.***> 于2022年9月28日周三 20:47写道:
… 感谢你的详细分析 待修复
—
Reply to this email directly, view it on GitHub
<#1231 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPLTYOD7DZQELWAWGEW67DWAQ44TANCNFSM6AAAAAAQXXBWO4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Pending issue as far as I know |
Fixed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DNS服务器未返回有效的A记录或AAAA记录, 不存在TTL, 但是DNS解析结果仍然被xray内置DNS缓存, 发生这种情况后只能重启xray,
希望内置DNS仅缓存存在有效IP的, 有明确TTL的A记录或AAAA记录, 日志如下:
➜ ~ dig sdfsdf.sdf @127.0.0.1
; <<>> DiG 9.10.6 <<>> sdfsdf.sdf @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 16470
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;sdfsdf.sdf. IN A
;; Query time: 6 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Sep 28 20:10:38 CST 2022
;; MSG SIZE rcvd: 28
日志:
2022/09/28 19:50:21 [Info] app/dns: UDP:119.29.29.29:53 got answer: sdfsdf.sdf. TypeA -> [] 10.821095ms
2022/09/28 19:50:21 [Debug] app/dns: UDP:119.29.29.29:53 updating IP records for domain:sdfsdf.sdf.
从日志中可以看出, DNS解析结果中TypeA对应的是一个空的数组, 此时是不存在带有TTL的有效A记录的, 此时不应该执行后续的“updating IP records for domain..."
https://github.com/XTLS/Xray-core/blob/main/app/dns/nameserver_udp.go
文件中的HandleResponse方法结尾处代码应考虑此类情况(空的数组?):
if len(req.domain) > 0 && (rec.A != nil || rec.AAAA != nil) { s.updateIP(req.domain, &rec) }
The text was updated successfully, but these errors were encountered: