/dns/ vs /ipns/ for domains?

Why is it /ipns/domain.com instead of /dns/domain.com ?

Under the hood it’s using the IPNS protocol not the DNS protocol

Is there a spec on this? I thought the IPNS protocol used public keys and doing this does a TXT record lookup on DNS?

Not sure about spec so take this with a grain of salt. Also worth mentioning that IPNS is currently very, very slow

The TXT is more a trick to expose IPFS hashes for traditional domain names:

$ dig ipfs.io TXT
...
ipfs.io.                60      IN      TXT     "dnslink=/ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao"

-> http://gateway.ipfs.io/ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao

IPNS functions like an alias to an IPFS hash… using that same ipfs.io webpage:

$ ipfs name publish QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao
Published to QmNrCH1AbanMUJ2vWn7LLVyixEWdt3fhyQXzMEuJL5QqsZ: /ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao

So now /ipns/QmNrCH1AbanMUJ2vWn7LLVyixEWdt3fhyQXzMEuJL5QqsZ -> /ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao

Can check with

ipfs name resolve -r QmNrCH1AbanMUJ2vWn7LLVyixEWdt3fhyQXzMEuJL5QqsZ

IIRC IPNS entires only last for 12 hours so those might not work by the time you read this :slight_smile: but if so…

http://gateway.ipfs.io/ipns/QmNrCH1AbanMUJ2vWn7LLVyixEWdt3fhyQXzMEuJL5QqsZ

Yes, this is why I’m confused. I understand IPNS, and I understand the dnslink stuff, but not sure why the NURI for a dnslink starts with /ipns/... – in what way does it use ipns? Is it because dnslink is considered “part of” the ipns spec? Seems confusing to have these two different namespaces under the same prefix

Further, one can resolve dnslink with both ipfs name resolve (ipns command) and also ipfs dns – adding to the confusion.

1 Like