Skip to content
Pinner.xyz

Publish with IPNS

IPNS (InterPlanetary Name System) lets you publish content under a stable name that can be updated to point at new CIDs. This is useful for websites that update frequently; instead of changing DNS records every time, you update the IPNS record.

How IPNS fits into website hosting

When you create a website, you can set target_type to either ipfs or ipns:

  • ipfs: The domain points directly at a CID. To update, change target_hash on the website record.
  • ipns: The domain points at an IPNS name. To update, republish the IPNS name with a new CID. The domain doesn't change.

IPNS adds a layer of indirection. You update content by republishing the IPNS name instead of updating the website record.

Manage IPNS keys

List keys

pinner ipns keys list

Create a key

pinner ipns keys create my-website-key

Delete a key

pinner ipns keys delete <key-name-or-id>

Publish content to an IPNS name

Point an IPNS name at a CID:

pinner ipns publish <cid> --key-name <key-name-or-id>

Create a website with an IPNS target

const site = await pinner.websites.createWebsite({
  domain: "mysite.example.com",
  target_type: "ipns",
  target_hash: key.ipns_name,
});

Now when you update your site, publish a new CID to the same IPNS name; the domain follows automatically.

Republish

IPNS records have a limited lifetime. Republish to extend it:

pinner ipns republish <key-name-or-id>

Resolve an IPNS name

Look up what CID an IPNS name currently points to:

pinner ipns resolve k51qzi5...

When to use IPNS vs direct IPFS

ScenarioUse
Static content that rarely changesDirect IPFS (target_type: "ipfs")
Frequently updated sitesIPNS (target_type: "ipns")
CI/CD automated deploys
One-off deployments

IPNS resolution is slightly slower than direct IPFS because it adds a lookup step. For most sites, the difference is negligible.