Skip to content
This repository was archived by the owner on Jun 2, 2020. It is now read-only.

Commit bef3dfa

Browse files
authored
Merge pull request #110 from lidel/add-dnslink-via-subdomain
docs: add section about DNSLink via Subdomain
2 parents 2c96150 + 63f3f53 commit bef3dfa

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

content/guides/concepts/dnslink.md

+31-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ menu:
55
parent: concepts
66
---
77

8-
DNSLink uses DNS records to map a domain name (like `ipfs.io`) to an IPFS address. Because you can edit your DNS records, you can use them to always point to the latest version of an object in IPFS (remember that an IPFS object’s address changes if you modify the object). Because DNSLink uses DNS records, the names it produces are also usually easy to type and read.
8+
DNSLink uses [DNS TXT](https://en.wikipedia.org/wiki/TXT_record) records to map
9+
a domain name (like `ipfs.io`) to an IPFS address. Because you can edit your
10+
DNS records, you can use them to always point to the latest version of an
11+
object in IPFS (remember that an IPFS object’s address changes if you modify
12+
the object). Because DNSLink uses DNS records, the names it produces are also
13+
usually easy to type and read.
914

10-
A DNSLink address looks like an [IPNS](/concepts/ipns) address, but it uses a domain name in place of a hashed public key:
15+
A DNSLink address looks like an [IPNS](/guides/concepts/ipns) address, but it
16+
uses a domain name in place of a hashed public key:
1117

1218
```
1319
/ipns/ipfs.io
@@ -25,9 +31,9 @@ When an IPFS client or node attempts to resolve that address, it looks for a `TX
2531
dnslink=/ipfs/<CID for your content here>
2632
```
2733

28-
For example, if you look up ipfs.io’s DNS records, you’ll see its DNSLink entry (see “answer section” at the bottom):
34+
For example, if you look up `ipfs.io`’s DNS records, you’ll see its DNSLink entry:
2935

30-
```
36+
```sh
3137
$ dig +noall +answer TXT ipfs.io
3238
ipfs.io. 59 IN TXT "dnslink=/ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao"
3339
```
@@ -43,3 +49,24 @@ Will get you this block:
4349
```
4450
/ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao/media/
4551
```
52+
53+
54+
## Publishing via a Subdomain
55+
56+
You can also publish DNSLink records using a special subdomain named `_dnslink`. This is useful when you want to improve the security of an automated setup or delegate control over your DNSLink records to a third-party without giving away full control over the original DNS zone.
57+
58+
For example, [`docs.ipfs.io`](https://docs.ipfs.io) does not have a TXT record, but the page still loads
59+
because a TXT record exists for `_dnslink.docs.ipfs.io`:
60+
61+
```sh
62+
$ dig +noall +answer TXT _dnslink.docs.ipfs.io
63+
_dnslink.docs.ipfs.io. 34 IN TXT "dnslink=/ipfs/QmeveuwF5wWBSgUXLG6p1oxF3GKkgjEnhA6AAwHUoVsx6E"
64+
```
65+
66+
<!-- TODO: Once IPNS is more reliable, describe combining it with DNSLink.
67+
### Linking to IPNS
68+
69+
DNSLink can point at [IPNS](/guides/concepts/ipns) paths as well. IPNS path is
70+
a mutable pointer which enables you to update your website by publishing
71+
to a PeerID without the need for updating TXT record every time hash changes.
72+
-->

0 commit comments

Comments
 (0)