Conversation
Member
|
麻烦看一下 TestLocalNameServerWithIPv6Override 在 windows 这个测试 |
yuhan6665
reviewed
Sep 19, 2023
app/dns/nameserver_doh.go
Outdated
Member
There was a problem hiding this comment.
Do you think it make sense to extract this method to a common place?
Contributor
Author
There was a problem hiding this comment.
Created a more general function under nameserver.go
8507be4 to
422a15d
Compare
422a15d to
d52944f
Compare
Contributor
Author
可能跟windows下go的DNS lookup实现有关系,macos和linux都能过这个测试。稍微看了下源码, if r.preferGoOverWindows() {
return r.goLookupIP(ctx, network, name)
}
// TODO(bradfitz,brainman): use ctx more. See TODO below.
var family int32 = syscall.AF_UNSPEC
switch ipVersion(network) {
case '4':
family = syscall.AF_INET
case '6':
family = syscall.AF_INET6
}
...也有可能跟运行环境有关系,但是目前手上暂时没有windows的机器,所以没法测试。所以暂时移除了在local nameserver使用queryStrategy的功能。 |
Member
|
感谢佬! |
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.
There are multiple feature requests already to enable
queryStrategyconfiguration at the granularity of DNS name server: #1953 #1940. The PR adds a fieldqueryStrategyin NameServer struct to allow user to configure DNS query strategy for every NameServer instead of using a single option for all name servers.The configuration before looks likes this,
After this PR, users are allowed to specify the
queryStrategyoption for each of the NameServers, for example,To be compatible with the old configuration,
queryStrategyfield applied on the DNS config level still works. The NameServer levelqueryStrategyoption can be treated as another filter. This should be pretty straight-forward, for example, in the following case, the queryStrategy would be set toUseIP6,but in the following case, the
queryStrategywould always result in empty response, due to conflicting DNS option,Therefore, users are encouraged to use NameServer level
queryStrategyfield.queryStrategyis not set at NameServer level, the NameService will not override thequeryStrategysetting. The behavior of the DNS resolver should remain the same as previous.