fix: regression in 'ipfs dns'
this command used to work with domain without `/ipns/` prefix. we've switched it to the same backend as `resolve` command, which requires the prefix, so we add it if it is missing
Marcin Rataj committed
Nov 8, 2023 at 21:30 UTC
670ce7043e3b0af52a25a69569464cd3c256d3ee
1 file changed
+6
-1
core/commands/dns.go
+6
-1
@@ -3,6 +3,7 @@ package commands
3
import (
4
"fmt"
5
"io"
6
+ "strings"
7
8
namesys "github.com/ipfs/boxo/namesys"
9
"github.com/ipfs/boxo/path"
@@ -19,7 +20,7 @@ const (
20
var DNSCmd = &cmds.Command{
21
Status: cmds.Deprecated, // https://github.com/ipfs/kubo/issues/8607
22
Helptext: cmds.HelpText{
22
- Tagline: "Resolve DNSLink records.",
23
+ Tagline: "Resolve DNSLink records. Deprecated: Use 'ipfs resolve /ipns/domain-name' instead.",
24
ShortDescription: `
25
This command can only recursively resolve DNSLink TXT records.
26
It will fail to recursively resolve through IPNS keys etc.
@@ -52,6 +53,10 @@ It will work across multiple DNSLinks and IPNS keys.
53
routing = append(routing, namesys.ResolveWithDepth(1))
54
}
55
56
+ if !strings.HasPrefix(name, "/ipns/") {
57
+ name = "/ipns/" + name
58
+ }
59
+
60
p, err := path.NewPath(name)
61
if err != nil {
62
return err