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

IPNS dns record incorrect #760

Closed
jbenet opened this issue Feb 7, 2015 · 11 comments
Closed

IPNS dns record incorrect #760

jbenet opened this issue Feb 7, 2015 · 11 comments
Labels
topic/ipns Topic ipns

Comments

@jbenet
Copy link
Member

jbenet commented Feb 7, 2015

AFAICT the IPNS record lookup is currently incorrect:

    txt, err := net.LookupTXT(name)
    if err != nil {
        return "", err
    }

    for _, t := range txt {
        chk := b58.Decode(t)

It should be:

    for _, t := range txt {
        if !strings.HasPrefix(t, "ipns=") {
            continue
        }
        chk := b58.Decode(t[5:])

I'll be changing it, which may break people's IPNS names.

@kevinwallace
Copy link
Contributor

Related: the paper says that IPNS DNS records can point either directly to IPFS objects or recursively to other IPNS paths. Right now, the code only handles resolving direct references to IPFS objects, and the TXT record encoding scheme doesn't specify how to distinguish the two.

@whyrusleeping
Copy link
Member

I assume it should be:

ipns=/ipfs/QmSomeHash

or for an ipns path:

ipns=/ipns/QmSomeOtherHash

@jbenet
Copy link
Member Author

jbenet commented Feb 9, 2015

I started on this at https://github.com/jbenet/go-ipfs/commits/ipns-resolution -- that's a stash, the last commit doesn't even compile.

In the interest of only using one DNS TXT key, and making it non-ipfs specific (/ extensible to other resolution):

dnslink=/ipfs/Qm...
dnslink=/ipns/Qm...

Then there's also other unresolved questions, like recursive resolution depth-- how far should ipns names be able to point to each other?

@whyrusleeping
Copy link
Member

normally unix systems define MAXLINKS to be around 32

@whyrusleeping whyrusleeping added the help wanted Seeking public contribution on this issue label Feb 25, 2015
@jbenet jbenet added the topic/ipns Topic ipns label Mar 28, 2015
@maxired
Copy link

maxired commented Apr 7, 2015

Hi,

have you considered using other type of DNS entrie such as :

  • DNS SRV (which handle protocols by '_' ) ?
_ipns.example.com. 86400 IN SRV 10 10 0 _ipfs.QmSomeHash.
  • or maybe with CNAME (which is like a DNS link) , mixing the syntax ?
_ipns.example.com.  CNAME _ipfs.QmSomeHash.

this might make sense if you want to do something non-ipfs specific

@jbenet
Copy link
Member Author

jbenet commented Apr 8, 2015

@maxired yep we considered them, but SRV has a bunch of complicated rules (specific to its target use case) and CNAME doesnt work (it must be another domain, we want a unix path).

@jbenet
Copy link
Member Author

jbenet commented Apr 12, 2015

Note to those who (want to) use DNS TXT resolution

The format of the DNS TXT record is currently:

// format
<hash>

// example
QmajFHHivh25Qb2cNbnnnEeUe1gDLHX9ta7hs2XKX1vazb

The format will be:

// format
dnslink=<ipfs-path>

// example
dnslink=/ipfs/QmZfqVvnqesSyFosEAQPZBcfeepfey5efkLZSwm3sySp36/cat.jpg

You should be able to add both records and have it (a) work now, and (b) work when we change it.

@Kubuxu
Copy link
Member

Kubuxu commented Dec 29, 2015

Since 28th April (v0.3.3) both schemas are working.

Is it a time to remove old schema?

@whyrusleeping
Copy link
Member

@Kubuxu sure, wanna file a PR for that?

@Kubuxu
Copy link
Member

Kubuxu commented Dec 29, 2015

Sure

Kubuxu added a commit to Kubuxu/go-ipfs that referenced this issue Dec 29, 2015
As for now only dnslink is valid.
Fixes ipfs#760

License: MIT
Signed-off-by: Jakub (Kubuxu) Sztandera <kubuxu@gmail.com>
Kubuxu added a commit to Kubuxu/go-ipfs that referenced this issue Dec 29, 2015
As for now only dnslink is valid.
Fixes ipfs#760

License: MIT
Signed-off-by: Jakub (Kubuxu) Sztandera <kubuxu@gmail.com>
@daviddias daviddias removed the icebox label Jan 2, 2016
Kubuxu added a commit to Kubuxu/go-ipfs that referenced this issue Jan 12, 2016
As for now only dnslink is valid.
Fixes ipfs#760

License: MIT
Signed-off-by: Jakub (Kubuxu) Sztandera <kubuxu@gmail.com>
@jbenet jbenet removed the help wanted Seeking public contribution on this issue label Jan 13, 2016
@jbenet
Copy link
Member Author

jbenet commented Jan 13, 2016

This is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/ipns Topic ipns
Projects
None yet
Development

No branches or pull requests

7 participants