Using ENS names¶
In order to resolve ENS names, your Swarm node has to be connected to an Ethereum blockchain (mainnet, or testnet). See Getting Started for instructions. This section explains how you can register your content to your ENS name.
ENS is the system that Swarm uses to permit content to be referred to by a human-readable name, such as “theswarm.eth”. It operates analogously to the DNS system, translating human-readable names into machine identifiers - in this case, the Swarm hash of the content you’re referring to. By registering a name and setting it to resolve to the content hash of the root manifest of your site, users can access your site via a URL such as
Currently The bzz scheme is not supported in major browsers such as Chrome, Firefox or Safari. If you want to access the bzz scheme through these browsers, currently you have to either use an HTTP gateway, such as https://swarm-gateways.net/bzz:/theswarm.eth/ or use a browser which supports the bzz scheme, such as Mist <https://github.com/ethereum/mist>.
Suppose we upload a directory to Swarm containing (among other things) the file
$ swarm --recursive up /path/to/dir >2477cc8584cc61091b5cc084cdcdb45bf3c6210c263b0143f030cf7d750e894d
If we register the root hash as the
theswarm.eth, then we can access the pdf at
if we are using a Swarm-enabled browser, or at
via a local gateway. We will get served the same content as with:
Please refer to the official ENS documentation for the full details on how to register content hashes to ENS.
In short, the steps you must take are:
- Register an ENS name.
- Associate a resolver with that name.
- Register the Swarm hash with the resolver as the
We recommend using https://manager.ens.domains/. This will make it easy for you to:
- Associate the default resolver with your name
- Register a Swarm hash.
When you register a Swarm hash with https://manager.ens.domains/ you MUST prefix the hash with 0x. For example 0x2477cc8584cc61091b5cc084cdcdb45bf3c6210c263b0143f030cf7d750e894d
Overview of ENS (video)¶
Nick Johnson on the Ethereum Name System