mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-05 00:08:06 +08:00
dns: update dns command docs
License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
This commit is contained in:
parent
c3204a6939
commit
89b233e360
@ -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
|
||||
`,
|
||||
},
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user