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

Commit

Permalink
Merge pull request #110 from lidel/add-dnslink-via-subdomain
Browse files Browse the repository at this point in the history
docs: add section about DNSLink via Subdomain
  • Loading branch information
Mr0grog authored Aug 23, 2018
2 parents 2c96150 + 63f3f53 commit bef3dfa
Showing 1 changed file with 31 additions and 4 deletions.
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.
-->

0 comments on commit bef3dfa

Please sign in to comment.