Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Implement DNS query API #904

Closed
Closed
@lidel

Description

@lidel

Background

The /api/v0/dns/ API was created in go-ipfs as a workaround for doing dnslink lookups in webpage and browser addon contexts (ipfs/kubo#1054, ipfs/ipfs-companion#44).

Problem

Mozilla bug #1343849 means we won't have a native WebExtension API for DNS TXT lookups. Even if Mozilla decides to add a custom API for this to Firefox, it won't be present in Chromium-based browsers.

Our long term goal is to have an option to run js-ipfs node in WebExtension (ipfs/ipfs-companion#248) without relying on external HTTP Gateway provided bygo-ipfs.

Solution

We need a robust, portable DNS lookup solution that works everywhere. This means js-ipfs needs to provide in-house implementation for /api/v0/dns/ that works in "browserified" version. We won't be able to support dnslink in web browsers without it.

Request-Response Examples

DNS lookup API is already implemented by go-ipfs (ipfs/kubo#1054):

Site with dnslink:

GET http://localhost:5001/api/v0/dns/ipfs.io

{"Path":"/ipfs/QmbB5He9XBy7TpsuEwF8twUA2FvK4x8DTUjsANVaQAPDDh"}

Site without dnslink in TXT record:

GET http://localhost:5001/api/v0/dns/google.com:

{"Message":"could not resolve name.","Code":0}

Other thoughts

Metadata

Metadata

Assignees

Labels

P3Low: Not priority right nowexp/wizardExtensive knowledge (implications, ramifications) requiredhelp wantedSeeking public contribution on this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions