From 670ce7043e3b0af52a25a69569464cd3c256d3ee Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 8 Nov 2023 21:30:38 +0100 Subject: [PATCH] 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 --- core/commands/dns.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/commands/dns.go b/core/commands/dns.go index 5126a6cb153..065b4acdc9a 100644 --- a/core/commands/dns.go +++ b/core/commands/dns.go @@ -3,6 +3,7 @@ package commands import ( "fmt" "io" + "strings" namesys "github.com/ipfs/boxo/namesys" "github.com/ipfs/boxo/path" @@ -19,7 +20,7 @@ const ( var DNSCmd = &cmds.Command{ Status: cmds.Deprecated, // https://github.com/ipfs/kubo/issues/8607 Helptext: cmds.HelpText{ - Tagline: "Resolve DNSLink records.", + Tagline: "Resolve DNSLink records. Deprecated: Use 'ipfs resolve /ipns/domain-name' instead.", ShortDescription: ` This command can only recursively resolve DNSLink TXT records. It will fail to recursively resolve through IPNS keys etc. @@ -52,6 +53,10 @@ It will work across multiple DNSLinks and IPNS keys. routing = append(routing, namesys.ResolveWithDepth(1)) } + if !strings.HasPrefix(name, "/ipns/") { + name = "/ipns/" + name + } + p, err := path.NewPath(name) if err != nil { return err