DEV Community

dAppling
dAppling

Posted on • Edited on • Originally published at blog.dappling.network

How to: IPNS on my Domain?

First, why would you want this? IPNS is another way to access content on the IPFS network. Since the link to the content is set on the DNS itself, the attack surface is slightly smaller, as the malicious user would need access at the DNS level to be successful. Also, as it's closer to traditional website access, while also showing the user direct IPFS accessing of the content is happening.

There's more information about what's IPNS? as well as a great guide about how resolving DNSLink works, but I'll go over the steps in a very high-level manner here.

The next steps you can try yourself, and you should be able to see Uniswap's Interface at the end.

1️⃣ Get your CID for the site you want to share with users. It will look something like bafybeibngzztaxprxg6w423plup5kihnizu4t4fdcsq73wgqcayvjrxoaq.

  • You can use dAppling to build your code into a CID.

2️⃣ Go to your DNS provider and add a record to your domain.

  • Choose the domain you want the users to type in. Usually, the root domain makes sense.
  • Add a text record with the subdomain of _dnslink and the value set as dnslink=/ipfs/<CID>
TXT _dnslink   dnslink=/ipfs/bafybeibngzztaxprxg6w423plup5kihnizu4t4fdcsq73wgqcayvjrxoaq
Enter fullscreen mode Exit fullscreen mode

If you want a subdomain, e.g. ipfs.example.com, the subdomain used would be _dnslink.ipfs

TXT _dnslink.ipfs dnslink=/ipfs/bafybeibngzztaxprxg6w423plup5kihnizu4t4fdcsq73wgqcayvjrxoaq
Enter fullscreen mode Exit fullscreen mode

3️⃣ After set, you can direct users to the site via IPNS and a gateway. These would be accessible with a gateway, like Cloudflare, using their ipns path using subdomains (recommended):

or using paths (not recommended):

What are the downsides? For one, the record will not be updated if you push changes to your code. This will need to be either automated (if the DNS supports it) or done manually.

We do not currently try updating the IPNS record as we handle the CID resolution automatically when setting up a domain on dAppling, but we think IPNS is an interesting access point, and it's more accessible.

Top comments (0)