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.
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
- 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
_dnslinkand the value set as
TXT _dnslink dnslink=/ipfs/bafybeibngzztaxprxg6w423plup5kihnizu4t4fdcsq73wgqcayvjrxoaq
If you want a subdomain, e.g. ipfs.example.com, the subdomain used would be
TXT _dnslink.ipfs dnslink=/ipfs/bafybeibngzztaxprxg6w423plup5kihnizu4t4fdcsq73wgqcayvjrxoaq
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.