dns: update dns command docs

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
This commit is contained in:
Lars Gierth 2016-03-03 17:06:10 +01:00
parent c3204a6939
commit 89b233e360
2 changed files with 10 additions and 14 deletions

View File

@ -26,23 +26,20 @@ This command resolves those links to the referenced object.
For example, with this DNS TXT record:
ipfs.io TXT "dnslink=/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy ..."
> dig +short TXT ipfs.io
dnslink=/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
The resolver will give:
> ipfs dns ipfs.io
/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
> ipfs dns ipfs.io
/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
And with this DNS TXT record:
The resolver can recursively resolve:
ipfs.ipfs.io TXT "dnslink=/dns/ipfs.io ..."
The resolver will give:
> ipfs dns ipfs.io
/dns/ipfs.io
> ipfs dns --recursive
/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
> dig +short TXT recursive.ipfs.io
dnslink=/ipns/ipfs.io
> ipfs dns -r recursive.ipfs.io
/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
`,
},

View File

@ -18,8 +18,7 @@ var ErrNoNamesys = errors.New(
// Resolve resolves the given path by parsing out protocol-specific
// entries (e.g. /ipns/<node-key>) and then going through the /ipfs/
// entries and returning the final merkledag node. Effectively
// enables /ipns/, /dns/, etc. in commands.
// entries and returning the final merkledag node.
func Resolve(ctx context.Context, n *IpfsNode, p path.Path) (*merkledag.Node, error) {
if strings.HasPrefix(p.String(), "/ipns/") {
// resolve ipns paths