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

Support /dnsaddr in web environments (wasm-bindgen) #5531

Open
oblique opened this issue Aug 5, 2024 · 2 comments
Open

Support /dnsaddr in web environments (wasm-bindgen) #5531

oblique opened this issue Aug 5, 2024 · 2 comments

Comments

@oblique
Copy link
Contributor

oblique commented Aug 5, 2024

Description

Enable DNS lookup for web environments (wasm-bindgen). This can be achieved with DNS over HTTPS.

Motivation

I want to be able to use /dnsaddr in web environments.

Requirements

There are two options to implement this:

  1. libp2p-dns needs to be internally refactored to hide hickory types from WASM. Also we need to decide if we are going to support DoH to native systems as well, or if it will be just for WASM.
  2. Create libp2p-dns-websys. The bad thing about this is to reimplement all the retry logic. The good part about this is that we need to implement support only for /dnsaddr since /dns can be handled well by *-websys transprots.

Examples of querying DoH:

Lookup for IPv4

curl --header 'accept: application/dns-json' 'https://1.1.1.1/dns-query?type=1&name=cloudflare.com'

Lookup for IPv6

curl --header 'accept: application/dns-json' 'https://1.1.1.1/dns-query?type=28&name=cloudflare.com'

Lookup for TXT

curl --header 'accept: application/dns-json' 'https://1.1.1.1/dns-query?type=16&name=cloudflare.com'

Open questions

No response

Are you planning to do it yourself in a pull request ?

Maybe

@dariusc93
Copy link
Member

I have attempted this myself a few months ago but couldnt really settle on how I would want but do think we could go with 2, which would keep inline with what we are doing now.

@DougAnderson444
Copy link
Contributor

DougAnderson444 commented Oct 3, 2024

+1

(I just opened #5619 for this same thing, so I will close that as it's duplicate of this issue)

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

3 participants