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> Add a DNS over HTTPS backend resolver #24

Closed
wants to merge 1 commit into from

Conversation

steamraven
Copy link

@steamraven steamraven commented Oct 21, 2020

Some projects do not want to or cannot use the standard DNS backend to resolve multaddrs. For example, wasm in the browser does not have access to UDP DNS. Other projects may want extra security or do not want the underlying network to rewrite DNS queries

This commit adds a very simple DNS over HTTPS backend resolver for multiaddrs. Since it is using the JSON specification as implemented by Google and Cloudflare, the resulting resolver is super simple.

This could be broken out into a completely separate project (go-multiaddr-dns-doh)

Please let me know if I can improve this

Some systems may not want to or cannot use the standard DNS resolver. For example,
wasm in the browser cannot issue UDP DNS requests.  This allows a simple alternative
implmentation.

This DNS over HTTPS uses the JSON specification that both Google and Cloudflare
support
@steamraven steamraven changed the title <RFC> Wasm: Add a DNS over HTTPS backend resolver for wasm <RFC> Add a DNS over HTTPS backend resolver Oct 25, 2020
@Stebalien
Copy link
Member

I agree supporting DOH would be useful, but this code doesn't look multiaddr specific in any way. I assume someone using DOH would set the multiaddr dns resolver in their code and import their favorite DOH client library (possibly this one).

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick feedback: We should avoid JSON requests. JSON representation is not an official DoH spec.

It may be standardized at one point, but right now, only the binary format defined by RFC8484 is future-proof.
To guarantee people can use resolvers other than Google and Cloudflare we should make queries in the binary format.

I wrote some notes in https://github.com/ipfs/js-ipfs/issues/2212, including test endpoints compatible with RFC8484, including one used by Firefox. Hope this helps if you wish to make a vendor-agnostic DoH (RFC8484) resolver.

@aschmahmann
Copy link

Just to clarify there are 2 action items here:

  1. This PR is not spec compliant as @lidel mentioned above
  2. This PR is a go-dns-doh resolver having nothing to do with multiaddr, you shouldn't be losing out on anything by just making this a separate repo as it could just be plugged into DefaultResolver here by application code.

@lidel
Copy link
Member

lidel commented Apr 9, 2021

Superseded by #26@aschmahmann are you able to close this?

@aschmahmann aschmahmann closed this Apr 9, 2021
@aschmahmann
Copy link

@lidel #26 isn't really related here other than adding more configurability to the resolver.

As I mentioned above plugging a DoH resolver into the interfaces should do the job. There is now a spec compliant DoH resolver at https://github.com/libp2p/go-doh-resolver.

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

Successfully merging this pull request may close these issues.

4 participants