Skip to content

feat(dns): Implement resolving /dnsaddr for wasm target#6471

Open
dariusc93 wants to merge 6 commits into
libp2p:masterfrom
dariusc93:feat/dns-websys
Open

feat(dns): Implement resolving /dnsaddr for wasm target#6471
dariusc93 wants to merge 6 commits into
libp2p:masterfrom
dariusc93:feat/dns-websys

Conversation

@dariusc93
Copy link
Copy Markdown
Member

@dariusc93 dariusc93 commented Jun 4, 2026

Description

This PR introduces a libp2p-dns-websys, largely inspired by libp2p-dns internals, allowing the client to resolve /dnsaddr as well as /dns{4,6} (for webrtc since this transport for webrtc-websys doesnt resolve or utilize/dns* but expects a /ip*) using DoH (DNS-over-HTTPS). By default, it uses cloudflare endpoint to resolve the DNS but can use a custom endpoint.

Resolves #5531.

AI Assistance Disclosure

Tools used (required — write none if no AI was used): none

Attestation (required):

  • I have read every line of this diff, understand what it does, and can explain it in review.

Notes & open questions

  1. While this is a separate crate to keep the same pattern as we have done for other respected transports, should this remain separate or should be move it to be apart of libp2p-dns instead?
  2. Should we rely on a different endpoint by default?
  3. Does it make sense to be more protocol-aware in regards to webrtc (or webrtc-direct) or should we also have the protocol handle/resolve /dns* and leave this crate to only resolve /dnsaddr?

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@dariusc93 dariusc93 changed the title feat(dns): Implement DoH for wasm target feat(dns): Implement resolving /dnsaddr for wasm target Jun 4, 2026
@dariusc93 dariusc93 requested a review from jxs June 4, 2026 22:20
@dariusc93 dariusc93 marked this pull request as ready for review June 4, 2026 22:30
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.

Support /dnsaddr in web environments (wasm-bindgen)

1 participant