Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNSLink sometimes redirect to IPNS and othertimes IPFS depending on whether a DNS-CNAME-to-IPFS or DNS-IPNS-to-IPFS redirect is involved #20320

Closed
da2x opened this issue Jan 4, 2022 · 5 comments · Fixed by brave/brave-core#12088

Comments

@da2x
Copy link

da2x commented Jan 4, 2022

Steps to Reproduce

  1. Set up a local IPFS node from brave://settings/ipfs
  2. Enable automatically redirect DNSLink to IPFS from the same page
  3. Open a tab and visit https://ipfs.io, wait for it to redirect to IPFS and note the resulting address.
  4. Open a tab and visit https://docs.ipfs.io, wait for it to redirect to IPFS and note the resulting address.

Actual result:

The address field shows ipns://ipfs.io/ for the first tab, but ipfs://bafybeic6n535syl7mivyh4wciefsbrxh5gztef3jtjid4abqvkss6a2wyy/ for the second tab.

Expected result:

The difference between the two domain is how the DNS records and DNSLink is configured. However, the end-result is always the same (an IPFS record). So, either both domains are expected to return ipns://ipfs.io/ and ipns://docs.ipfs.io/ OR both are expected to return ipfs://bafybeihi23ixdqi4vsh6rpklnk65nqiix7mgziwi2pb3keckrvpi2aauxu/ and ipfs://bafybeic6n535syl7mivyh4wciefsbrxh5gztef3jtjid4abqvkss6a2wyy/, respectively.

I can’t say which is the expected result, only that they return different answers is unexpected. I’m leaning towards always using IPNS-domain masking whenever possible, though. (It simplifies issues like #14774 and others.)

It’s unspecified in the DNSLink and IPNS specs how this should be handled, so @lidel should confirm the expected behavior.

Reproduces how often:

Every time.

Brave version (brave://version info)

Brave | 1.33.106 Chromium: 96.0.4664.110 (Official Build) unknown (64-bit)

Other Additional Information:

dig TXT _dnslink.ipfs.io.
_dnslink.ipfs.io.	300	IN	TXT	"dnslink=/ipns/website.ipfs.io"

dig TXT _dnslink.website.ipfs.io.
_dnslink.website.ipfs.io. 300	IN	CNAME	_dnslink.ipfs-website.on.fleek.co.
_dnslink.ipfs-website.on.fleek.co. 300 IN TXT	"dnslink=/ipfs/QmRokRMcoCNFX6gUqSBPqnvziUZiRc232Ms4hv9dBxDqTZ"


dig TXT _dnslink.docs.ipfs.io.
_dnslink.docs.ipfs.io.	300	IN	CNAME	_dnslink.ipfs-docs.on.fleek.co.
_dnslink.ipfs-docs.on.fleek.co.	300 IN	TXT	"dnslink=/ipfs/Qme1ZHHoH5MhmjjLwJYr7HYxPt8ps24ZhsPvrDUT3u3w2U

Miscellaneous Information:

@cqcallaw
Copy link

cqcallaw commented Jan 8, 2022

I can reproduce this on a clean install of Brave 1.34.80.

Enabling the IPFS Companion integration changes the behavior. With Companion integration enabled, ipns://ipfs.io/ and ipns://docs.ipfs.io/ are the final contents of the address bar.

@stephendonner
Copy link

Verified PASSED using

Brave 1.37.24 Chromium: 98.0.4758.87 (Official Build) nightly (64-bit)
Revision e4cd00f135fb4d8edc64c8aa6ecbe7cc79ebb3b2-refs/branch-heads/4758@{#1002}
OS Windows 10 Version 21H2 (Build 19044.1466)
  1. new profile
  2. loaded brave://ipfs
  3. clicked on install and start
  4. loaded brave://settings/ipfs
  5. chose Brave local IPFS node from Method to resolve IPFS resources
  6. toggled Automatically redirect to IPFS pages via DNSLink when possible to ON
  7. loaded https://ipfs.io
  8. confirmed I got redirected to ipns://ipfs.io
  9. loaded https://docs.ipfs.io

Confirmed I got docs.ipfs.io.ipns.localhost:48081 in the URL bar, and the content loaded.

example example example
20320-1 20320-2 20320-3

@stephendonner
Copy link

Verified PASSED using

Brave 1.37.87 Chromium: 99.0.4844.51 (Official Build) beta (arm64)
Revision d537ec02474b5afe23684e7963d538896c63ac77-refs/branch-heads/4844@{#875}
OS macOS Version 11.6.4 (Build 20G417)
example example example
Screen Shot 2022-03-10 at 4 23 52 PM Screen Shot 2022-03-10 at 4 24 57 PM Screen Shot 2022-03-10 at 4 25 52 PM

@stephendonner
Copy link

Verified PASSED using

Brave 1.37.101 Chromium: 99.0.4844.83 (Official Build) beta (x86_64)
Revision b11086e62d7c1a44b0942ac5568d22a425c7ae35-refs/branch-heads/4844_74@{#5}
OS macOS Version 12.3 (Build 21E230)
example example example example
Screen Shot 2022-03-22 at 5 13 12 PM Screen Shot 2022-03-22 at 5 13 47 PM Screen Shot 2022-03-22 at 5 16 23 PM Screen Shot 2022-03-22 at 5 16 43 PM

@btlechowski
Copy link

Verification passed on

Brave 1.37.101 Chromium: 99.0.4844.83 (Official Build) beta (64-bit)
Revision b11086e62d7c1a44b0942ac5568d22a425c7ae35-refs/branch-heads/4844_74@{#5}
OS Ubuntu 20 LTS

image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment