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

RFC - Custom DNS Resolver #2211

Open
imiskolee opened this issue May 13, 2024 · 2 comments
Open

RFC - Custom DNS Resolver #2211

imiskolee opened this issue May 13, 2024 · 2 comments
Labels
s: feature This issue indicates a feature request

Comments

@imiskolee
Copy link

imiskolee commented May 13, 2024

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"
 }
})
@imiskolee imiskolee added the s: feature This issue indicates a feature request label May 13, 2024
@AlexV525
Copy link
Member

Creating a custom HttpClientAdapter with the resolver would be feasible. Is there any concern that this should be added to the Dio class?

@imiskolee
Copy link
Author

@AlexV525 thanks, I will try out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: feature This issue indicates a feature request
Projects
None yet
Development

No branches or pull requests

2 participants