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

docs: add section about DNSLink via Subdomain #110

Merged
merged 2 commits into from
Aug 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions content/guides/concepts/dnslink.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ menu:
parent: concepts
---

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.
DNSLink uses [DNS TXT](https://en.wikipedia.org/wiki/TXT_record) 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.

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

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

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

```
```sh
$ dig +noall +answer TXT ipfs.io
ipfs.io. 59 IN TXT "dnslink=/ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao"
```
Expand All @@ -43,3 +49,24 @@ Will get you this block:
```
/ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao/media/
```


## Publishing via a Subdomain

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.

For example, [`docs.ipfs.io`](https://docs.ipfs.io) does not have a TXT record, but the page still loads
because a TXT record exists for `_dnslink.docs.ipfs.io`:

```sh
$ dig +noall +answer TXT _dnslink.docs.ipfs.io
_dnslink.docs.ipfs.io. 34 IN TXT "dnslink=/ipfs/QmeveuwF5wWBSgUXLG6p1oxF3GKkgjEnhA6AAwHUoVsx6E"
```

<!-- TODO: Once IPNS is more reliable, describe combining it with DNSLink.
### Linking to IPNS

DNSLink can point at [IPNS](/guides/concepts/ipns) paths as well. IPNS path is
a mutable pointer which enables you to update your website by publishing
to a PeerID without the need for updating TXT record every time hash changes.
-->