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 DNS #7

Closed
jbenet opened this issue Sep 11, 2014 · 17 comments
Closed

Support DNS #7

jbenet opened this issue Sep 11, 2014 · 17 comments

Comments

@jbenet
Copy link
Member

jbenet commented Sep 11, 2014

Multiaddrs like these should work:

/dns/ipfs.io
/dns/foo.bar.com/http
@ghost
Copy link

ghost commented Jul 28, 2015

This format in ambiguous regarding IPv4/IPv6. Other options:

/ip4/ipfs.io
/dns6/foo.net
/dnsAAAA/bar.com
/dns/baz.org/ip4

All of these would roughly resolve to /ip4/1.2.3.4 and /ip6/123::4. The last one has the most appeal imo.

@jbenet
Copy link
Member Author

jbenet commented Jul 28, 2015

also, which record? just A? or allow TXT to work too:

/dns/baz.org/

vs

/dns/baz.org/a/
/dns/baz.org/txt/

(hard to do defaults...)

(update: ahh i see you mentioned dnsAAAA too)

@jbenet
Copy link
Member Author

jbenet commented Jul 28, 2015

i like /dns/baz.org/ip4 though that's a bit tricky.

maybe:

/dns/baz.org/ip   # either 4 or 6
/dns/baz.org/ip4  # ipv4
/dns/baz.org/ip4  # ipv6

@ghost
Copy link

ghost commented Jul 28, 2015

maybe:

/dns/baz.org/ip   # either 4 or 6
/dns/baz.org/ip4  # ipv4
/dns/baz.org/ip4  # ipv6

yeah that's what i was after :)

A full example:

/dns/bootstrap1.ipfs.io/ip4/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ

It'd break with the quasi-rule that a protocol is a 2-tuple, but we can say that you MUST know how many segments follow once you see the first one -- e.g. you see /dns, and know there will be two more segments.

@jbenet
Copy link
Member Author

jbenet commented Jul 28, 2015

@lgierth that sounds good to me

It'd break with the quasi-rule that a protocol is a 2-tuple, but we can say that you MUST know how many segments follow once you see the first one -- e.g. you see /dns, and know there will be two more segments.

Yep, i think that's fine too (deterministic)

@jbenet
Copy link
Member Author

jbenet commented Jul 28, 2015

i also havent seen other multiaddr impls, so easy to change for us

@jbenet
Copy link
Member Author

jbenet commented Aug 11, 2015

@lgierth we should probably support record types here.

/dns/bootstrap1.ipfs.io/A/ip4

?

@ghost
Copy link

ghost commented Aug 11, 2015

Do you mean for SRV/TXT/etc. records? Cause A and AAAA always implicate ip4/ip6.

@jbenet
Copy link
Member Author

jbenet commented Aug 11, 2015

ah right 👍

@jbenet
Copy link
Member Author

jbenet commented Jan 24, 2016

Some comment i got by email is missing. for posterity:

I want to extend go-multiaddr and go-multiaddr-net to support dialing to /dns/baz.org/ws/80 and listening on /ip4/12.45.56.78/ws/80. Should I use /dns/baz.org/ip/tcp/80/ws and /ip4/12.45.56.78/tcp/80/ws instead? Also, what protocol codes you'd recommend for dns, ws and ip?

Yes you should use the /tcp/80/ws version instead.

@Gaboose
Copy link

Gaboose commented Feb 5, 2016

That's my comment. Thought it was a little off topic so I deleted it 🐰

But since you mention it, I'll have you know that I got /dns/baz.org/tcp/4324 and /dns/baz.org/tcp/4324/ws/echo to work on my modest attempt to a pluggable manet, no /dns/baz.org/ip4 though, because you can't create those with this library.

@ghost
Copy link

ghost commented Feb 5, 2016

no /dns/baz.org/ip4 though, because you can't create those with this library.

Yes we'll have to make a few changes to go-multiaddr, namely support for triplets, and some kind of resolution step that turns /dns/example.net/ip4 into /ip4/1.2.3.4

@Gaboose
Copy link

Gaboose commented Feb 5, 2016

The problem with "resolving /dns/example.net/ip4 to /ip4/1.2.3.4 and be done with it" for me was that /ws needs to know the hostname to include in http request headers, otherwise cloud services refuse the connection. So those two addresses are not equivalent.

@ghost
Copy link

ghost commented Feb 5, 2016

Your application code would be working with /dns addrs, while manet resolves these to /ip4 for internal use. Does that sound useful for your case?

@Gaboose
Copy link

Gaboose commented Feb 5, 2016

Well, I have my case solved, it doesn't matter to me much. But I do like (and did in my reimplementation) manet to handle connection differences between /dns/example.net/tcp/80/ws/echo and /ip4/127.0.0.1/tcp/4324 internally and make them interchangable for the external user. It makes things like manetcat possible.

EDIT: I'm just trying to seduce you with the neatness of this, and saying that it's possible and available. Not asking for anything.

@jbenet
Copy link
Member Author

jbenet commented Sep 16, 2016

@Gaboose

  • very nice work with your manet fork
  • have you seen the pluggability that @whyrusleeping added in-- what are your thoughts?
  • Good work on manetcat i made something similar in https://github.com/multiformats/ma-pipe -- it still needs more work, but worth a look. maybe we should converge in mnc or manc

@ghost
Copy link

ghost commented Nov 2, 2016

Closing this in favor of multiformats/multiaddr#22

@ghost ghost closed this as completed Nov 2, 2016
marten-seemann pushed a commit to marten-seemann/go-multiaddr that referenced this issue Feb 25, 2021
This issue was closed.
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

2 participants