docs: fix formatting and add links to DNS section
Marcin Rataj committed
Apr 13, 2021 at 23:09 UTC
0a4defe87b52d7f88aa453286e4dad3c129981ca
1 file changed
+27
-19
docs/config.md
+27
-19
@@ -695,6 +695,7 @@ If additional config is provided for those hostnames, it will be merged on top o
695
```
696
697
It is also possible to remove a default by setting it to `null`.
698
+
699
For example, to disable subdomain gateway on `localhost`
700
and make that hostname act the same as `127.0.0.1`:
701
@@ -715,13 +716,19 @@ Below is a list of the most common public gateway setups.
716
}
717
}'
718
```
718
- **Backward-compatible:** this feature enables automatic redirects from content paths to subdomains:
719
- `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.dweb.link`
720
- **X-Forwarded-Proto:** if you run go-ipfs behind a reverse proxy that provides TLS, make it add a `X-Forwarded-Proto: https` HTTP header to ensure users are redirected to `https://`, not `http://`. It will also ensure DNSLink names are inlined to fit in a single DNS label, so they work fine with a wildcart TLS cert ([details](https://github.com/ipfs/in-web-browsers/issues/169)). The NGINX directive is `proxy_set_header X-Forwarded-Proto "https";`.:
721
- `http://dweb.link/ipfs/{cid}` → `https://{cid}.ipfs.dweb.link`
722
- `http://dweb.link/ipns/your-dnslink.site.example.com` → `https://your--dnslink-site-example-com.ipfs.dweb.link`
723
- **X-Forwarded-Host:** we also support `X-Forwarded-Host: example.com` if you want to override subdomain gateway host from the original request:
724
- `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.example.com`
719
+ - **Backward-compatible:** this feature enables automatic redirects from content paths to subdomains:
720
+
721
+ `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.dweb.link`
722
+
723
+ - **X-Forwarded-Proto:** if you run go-ipfs behind a reverse proxy that provides TLS, make it add a `X-Forwarded-Proto: https` HTTP header to ensure users are redirected to `https://`, not `http://`. It will also ensure DNSLink names are inlined to fit in a single DNS label, so they work fine with a wildcart TLS cert ([details](https://github.com/ipfs/in-web-browsers/issues/169)). The NGINX directive is `proxy_set_header X-Forwarded-Proto "https";`.:
724
+
725
+ `http://dweb.link/ipfs/{cid}` → `https://{cid}.ipfs.dweb.link`
726
+
727
+ `http://dweb.link/ipns/your-dnslink.site.example.com` → `https://your--dnslink-site-example-com.ipfs.dweb.link`
728
+
729
+ - **X-Forwarded-Host:** we also support `X-Forwarded-Host: example.com` if you want to override subdomain gateway host from the original request:
730
+
731
+ `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.example.com`
732
733
734
* Public [path gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://ipfs.io/ipfs/{cid}` (no Origin separation)
@@ -741,12 +748,11 @@ Below is a list of the most common public gateway setups.
748
* Note that `NoDNSLink: false` is the default (it works out of the box unless set to `true` manually)
749
750
* Hardened, site-specific [DNSLink gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#dnslink-gateway).
744
- Disable fetching of remote data (`NoFetch: true`)
745
- and resolving DNSLink at unknown hostnames (`NoDNSLink: true`).
751
+
752
+ Disable fetching of remote data (`NoFetch: true`) and resolving DNSLink at unknown hostnames (`NoDNSLink: true`).
753
Then, enable DNSLink gateway only for the specific hostname (for which data
754
is already present on the node), without exposing any content-addressing `Paths`:
748
- "NoFetch": true,
749
- "NoDNSLink": true,
755
+
756
```console
757
$ ipfs config --json Gateway.NoFetch true
758
$ ipfs config --json Gateway.NoDNSLink true
@@ -1428,27 +1434,29 @@ Type: `priority`
1434
1435
## `DNS`
1436
1431
-Options for configuring DNS resolution.
1437
+Options for configuring DNS resolution for [DNSLink](https://docs.ipfs.io/concepts/dnslink/) and `/dns*` [Multiaddrs](https://github.com/multiformats/multiaddr/).
1438
1439
## `DNS.Resolvers`
1440
1435
-Map of FQDNs to resolver URLs.
1441
+Map of [FQDNs](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) to custom resolver URLs.
1442
1437
-This option allows you to specify domain-specific resolvers for custom DNS resolution.
1438
-Currently only https URLs are supported, using DNS over HTTPS.
1439
-
1440
-The default resolver can be overriden by specifying a URL for `.`.
1443
+- This allows for overriding the default cleartext DNS resolver provided by the operating system,
1444
+ and using different resolvers per domain or TLD (including ones from alternative, non-ICANN naming systems).
1445
+- Currently only `https://` URLs for [DNS over HTTPS](https://en.wikipedia.org/wiki/DNS_over_HTTPS) endpoints are supported.
1446
+- The default resolver can be overriden by adding an entry for the DNS root indicated by `.`
1447
1448
Example:
1443
-```
1449
+```json
1450
+{
1451
"DNS": {
1452
"Resolvers": {
1453
"eth.": "https://different-ens.example.net/dns-query",
1447
- "crypto.": "https://unstoppablesomething.example.com/dns-query",
1454
+ "crypto.": "https://resolver.unstoppable.io/dns-query",
1455
"libre.": "https://ns1.iriseden.fr/dns-query",
1456
".": "https://doh-ch.blahdns.com:4443/dns-query"
1457
}
1458
}
1459
+}
1460
```
1461
1462
Default: `null`