How would, or could, a web server be addressed?

It seems that services, as distinguished from files, are out of scope for ipfs. Or maybe not?

Would it be feasible, and if so, would it be practical, to - for example - load a website from an endpoint designated by an ipfs hash? Specifically, what is meant is not to retrieve the files by themselves, but to access a web app from an endpoint designated by an ipfs hash.

So for example, some kind of alternative content would need to be provided to stand in for the file content hash.

Or perhaps there is a related protocol that would be used for this, besides http?

This is the prime use case for two IPFS features - IPNS and _dnslink

IPNS allows you to “publish” a mutable content hash to an IPNS name. In other worse, your IPNS name becomes a pointer to a content hash that you specify. This is accomplished with the ipfs name publish command. Publishing is based on IPFS key pairs and uses the key pair of the IPFS node as default. If you want, you can use ipfs key gen to create a new named key to use as well.

_dnslink allows you to point a DNS address to the IPNS name. You would create a TXT entry in your DNS records called, with the value set to your IPNS name: /ipns/Qm.....

Finally, since IPNS resolution can be slow, and if you don’t mind updating your _dnwlink entry a lot more frequently, you can use it to point directly at the IPFS hash instead of the IPNS name.


1 Like