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

Consolidiffication of DNS requests for a host. #1034

Closed
Jorropo opened this issue Dec 18, 2020 · 3 comments
Closed

Consolidiffication of DNS requests for a host. #1034

Jorropo opened this issue Dec 18, 2020 · 3 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked

Comments

@Jorropo
Copy link
Contributor

Jorropo commented Dec 18, 2020

TL;DR:

While implementing DNS over Tor for anonymity we faced the impossibilities to proxy the DNS requests made by libp2p and libs using it, we should try to fix that.

Current status

I've identified 3 resolver spots and each one has a problem :


Proposed changes

Important (non breaking, or minor breaking):

  • go-dnslink:
    • split the dns / parsing part, sets the default exposed methods to use go-multiaddr-dns#DefaultResolver as backend.

Need more discussion:

  • Basic Host:
    • Add an DNSResolver options to go-libp2p#New, this would sets the basichost#Host.maResolver with a custom *madns.Resolver as argument.
    • Changes all internal usages in a host to using this internal resolver (might already be done idk, I will have to check).
  • host#Host
    • Exposes an API on the interface (maybe an optional extension of the interface ?) for dns, madns and dnslink releated requests.
    • Change go-ipfs to use this new API.

When we came to a consensus about that I'll be happy to implement it (I'll probably throw an ugly api and many replace go.mod rules since).

@Jorropo Jorropo added the kind/enhancement A net-new feature or improvement to an existing feature label Dec 18, 2020
@aschmahmann
Copy link
Collaborator

aschmahmann commented Dec 18, 2020

I agree that having a more configurable way to issue DNS requests that doesn't involve setting a global variable is a reasonable idea 👍.

However, I think a good deal of this is either done already or is an application level issue (e.g. ipfs/kubo#6532).

@Jorropo is there something I'm missing here, and if not is this issue closable?

@Jorropo
Copy link
Contributor Author

Jorropo commented Dec 18, 2020

BasicHost: It seems like this can be set by utilizing a custom MultiaddrResolver

There isn't any go-libp2p#Option who sets opts.MultiaddrResolver, I guess I can add one.

@aschmahmann aschmahmann added the status/ready Ready to be worked label Mar 15, 2021
@Stebalien
Copy link
Member

Fixed by

func MultiaddrResolver(rslv *madns.Resolver) Option {
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

3 participants