@@ -13,8 +13,9 @@ import (
13
13
core "github.com/ipfs/go-ipfs/core"
14
14
coreapi "github.com/ipfs/go-ipfs/core/coreapi"
15
15
namesys "github.com/ipfs/go-namesys"
16
- isd "github.com/jbenet/go-is-domain"
17
16
"github.com/libp2p/go-libp2p-core/peer"
17
+ dns "github.com/miekg/dns"
18
+
18
19
mbase "github.com/multiformats/go-multibase"
19
20
20
21
config "github.com/ipfs/go-ipfs-config"
@@ -351,9 +352,11 @@ func knownSubdomainDetails(hostname string, knownGateways gatewayHosts) (gw *con
351
352
// isDNSLinkName returns bool if a valid DNS TXT record exist for provided host
352
353
func isDNSLinkName (ctx context.Context , ipfs iface.CoreAPI , host string ) bool {
353
354
fqdn := stripPort (host )
354
- if len (fqdn ) == 0 && ! isd .IsDomain (fqdn ) {
355
+
356
+ if _ , ok := dns .IsDomainName (fqdn ); ! ok && len (fqdn ) == 0 {
355
357
return false
356
358
}
359
+
357
360
name := "/ipns/" + fqdn
358
361
// check if DNSLink exists
359
362
depth := options .Name .ResolveOption (nsopts .Depth (1 ))
@@ -473,7 +476,7 @@ func toSubdomainURL(hostname, path string, r *http.Request, ipfs iface.CoreAPI)
473
476
}
474
477
475
478
// Normalize problematic PeerIDs (eg. ed25519+identity) to CID representation
476
- if isPeerIDNamespace ( ns ) && ! isd . IsDomain ( rootID ) {
479
+ if _ , ok := dns . IsDomainName ( rootID ); ! ok && isPeerIDNamespace ( ns ) {
477
480
peerID , err := peer .Decode (rootID )
478
481
// Note: PeerID CIDv1 with protobuf multicodec will fail, but we fix it
479
482
// in the next block
0 commit comments