Skip to content
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未及时响应或无效响应时,应等待其他DNS的有效返回 #181

Closed
snowie2000 opened this issue Oct 21, 2019 · 7 comments

Comments

@snowie2000
Copy link

snowie2000 commented Oct 21, 2019

如下图所示
222

Overture尝试了部分dns后在明明其他dns有返回结果的情况下,最终依然返回了空白结果。

出现“Primary DNS response has no answer section but exist, finally use PrimaryDNS”,由于PrimaryDNS中的阿里dns未正确返回或者出错(我也不知道为什么会出错),overture认为应该用PrimaryDNS,但是结果却返回了阿里那个空白响应,并没有等待其他PrimaryDNS给出正确的响应。

这种情况很容易导致使用Overture后DNS查询失败率变高

@NyaMisty
Copy link
Contributor

这是实现问题,对每一组的dns,overture只取第一个收到的回复(不管有没有answer)
此外,这是你自己设置的失败的时候仍然用PrimaryDNS,你可以通过改"WhenPrimaryDNSAnswerNoneUse": "AlternativeDNS" 来让他自动fallback到Alternative DNS

@snowie2000
Copy link
Author

一般来说alternative里面都是国外的dns,不光性能较差,而且也不是cdn友好

国内的dns不管是哪个,出现响应问题都是稀疏平常的事情,而系统原生dns客户端没有overture的这个问题

@NyaMisty
Copy link
Contributor

NyaMisty commented Feb 17, 2020

国内的dns基本上都会正常工作,未发现有这样的现象
推荐切换到更加成熟的resolver,比如DNSPod和114DNS
绝大多数国内dns连接正常返回空answer的情形都是因为这个域名用了国外的ns,所以本来就应该落到alternative dns,所以大家平时根本就不用"WhenPrimaryDNSAnswerNoneUse": "PrimaryDNS"
不过确实可以修改一下"WhenPrimaryDNSAnswerNoneUse": "PrimaryDNS"情况下的处理

譬如你图中的域名应该是lux.mactype.win,这个域名的NS便是oraclecloud.net,本来就应该由alternativeDNS解析,不知道你到底想要达到什么效果
(膜mactype大佬)

@snowie2000
Copy link
Author

我确实不清楚具体出现这种情况是由于什么导致的,但是这种空answer的情况似乎并不罕见,而且dnsmasq等常见的dns recursor似乎都不存在遇到空answer就直接认可的情况,我也不知道他们具体是怎么样的逻辑

NS是国外的并不一定就应该由国外的dns去解析,例如常见的cf,可能cdn优化就会不太好,而且primarydns通常是能够正常解析出来的,只是部分dns抽风,如果能忽略空answer的话,primarydns会比alternative快很多

@NyaMisty
Copy link
Contributor

所以说先试试换一下DNS到其他主流的DNS试一下
有EDNS的话经测试google解析和国内是一样的
忽略空answer这个等到现有的pr被merge后改一下就行

@snowie2000
Copy link
Author

感谢解答,期待未来更好的版本。

@NyaMisty
Copy link
Contributor

https://ci.appveyor.com/project/NyaMisty/overture/builds/30845752
这个是我分支的nightly build,可以直接下载artifacts,目前还在等待被merge,可以试用一下
会在尝试drop none answer的时候输出DNSUpstream dns.google:853@8.8.4.4 returned None answer, dropping it and wait the next one (-v开关下)

shawn1m pushed a commit that referenced this issue Feb 19, 2020
… answer (#206)

* Refactored the RemoteClient to support connection pooling

Part of RemoteClient were split into several Resolver, which will be shared across all RemoteClient and RemoteClientBundle, in the resolver the pool was implemented.

* Fix dispatcher_test.go

* Remove too verbose debugging log output

* Add option IdleTimeout

* Wait until the answer presents in response (Fixes #181)

* Revert accidental change & better code format

* Support PoolMaxCapacity config

* Fix timeout setting

* Add tests for Resolvers
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

No branches or pull requests

2 participants