跳转到主要内容

DNSLink gateways

When you set up a gateway with a DNSLink record, that gateway is restricted to a particular piece of content — either a specific Content Identifier (CID) or an Interplanetary Name Service (IPNS) hostname. This is called a restricted gateway.

A restricted gateway differs from a universal gateway, which allows users to access any content hosted on the IPFS network.

What is DNSLink?

Every file on IPFS is identified by a CID — a long string like bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze. These CIDs are not practical for end users to type or remember, the same way IP addresses (192.0.2.1) are not practical compared to domain names (example.com).

:::note

For additional details, refer to the official IPFS documentation. :::

How is it used with Cloudflare?

You have the option to specify the DNSLink when you create an IPFS gateway, which serves as a custom hostname that directs users to a website already hosted on IPFS.

By default, your DNSLink path is /ipns/onboarding.ipfs.cloudflare.com. If you choose to put your website in a different content folder hosted at your own IPFS node or with a pinning service, you will need to specify that value.

For example, the default DNSLink record for www.example.com would look like this:

Record type Name Content
TXT _dnslink.www.example.com dnslink=/ipns/onboarding.ipfs.cloudflare.com

For more details about the DNS records created by the IPFS gateway, refer to Gateway DNS records.