RFC - Custom DNS Resolver
imiskolee opened this issue · 2 comments
imiskolee commented
Request Statement
Why do we need a custom DNS resolver?
Normally, the DNS resolution provided by the operating system depends on the local operator's dns server, which makes it difficult to control the DNS caching policy and resolution stability. In this case, we can try to use DNS Over HTTP as an alternative, or we can cache DNS results locally in the app according to a customized policy. Cache DNS to sqlite/file or other ways.
Solution Brainstorm
We can add a resolver method to configure, a common design in the Golang world.
final dio = Dio({
resolver : (domain) -> string {
return "1.2.3.4"
}
})
AlexV525 commented
Creating a custom HttpClientAdapter
with the resolver would be feasible. Is there any concern that this should be added to the Dio
class?