fix: no network caused by loop dns problem #759
+7
−10
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.
Background
daeuniverse/outbound#36
有一种可能的循环依赖情况:
dae 在解析节点域名的时候走了 resolv.conf,然后到了本地的 smartdns,smartdns 用国外 doh 被劫持代理到 dae,而代理需要过节点,而过节点需要解析节点域名……
本次为 direct dialer 添加一个选项 WithCache,该选项开启后,会记录 direct dialer 的上次成功的 host 对应的 ip,并在因dns查询超时而失败时对相同 host 用缓存的 ip 进行重试。对所有节点默认开启
注:direct dialer 是 proxy dialer 的最后一层,连节点用的
Checklist
Full Changelogs
Issue Reference
Closes #[issue number]
Test Result