libp2p / libp2p/rust-libp2p

Support `/dnsaddr` in web environments (wasm-bindgen)

Open
#5,531 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.6k
Forks
1.3k
Avg merge
8h 47m
Merged PRs (30d)
19

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing libp2p-dns and the two proposed approaches: hiding hickory types for WASM or adding libp2p-dns-websys. Examine the wasm-bindgen and DNS-over-HTTPS constraints, then determine how /dnsaddr should handle IPv4, IPv6, and TXT lookups in web environments. Done means a decided architecture and working /dnsaddr support for WASM.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.