Global Examiner

ENS domains

How ENS Domains Work: A Technical Guide to Ethereum Name Service

June 4, 2026 By Devon McKenna

How ENS Domains Work: A Technical Guide to Ethereum Name Service

The Ethereum Name Service (ENS) is a decentralized naming system built on the Ethereum blockchain. It maps human-readable names—like "alice.eth"—to machine-readable identifiers such as Ethereum addresses, content hashes, and metadata. Unlike traditional DNS, ENS is trustless, censorship-resistant, and fully governed by smart contracts. This article explains the core architecture, resolution mechanics, and practical considerations for using ENS domains.

1. Core Architecture: Registrars, Resolvers, and the Registry

ENS operates through three primary smart contract components that work together in a layered hierarchy:

  • The ENS Registry: A single smart contract at 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e that stores the owner of every domain and points to its resolver. The registry is immutable—nobody can alter its core logic.
  • Registrars: Smart contracts that control domain allocation. The .eth registrar (the "ETHRegistrarController") uses a permanent registration model with annual renewal fees. It replaced the original Vickrey auction system in 2019.
  • Resolvers: Contracts that translate a name into its associated data. A resolver can return addresses, text records (like email or social handles), content hashes for IPFS, or even other contract ABIs. The default resolver is a public resolver deployed at a fixed address, but owners may deploy custom resolvers.

When a user registers "example.eth," the registrar contract records ownership in the registry and sets a resolver. The resolver then maps the name hash—keccak256(keccak256("eth"), keccak256("example"))—to the owner's chosen address. This two-step indirection (registry → resolver → records) allows domain owners to change their records without transferring the name itself. For advanced users who manage multiple domains or delegate control, the ens delegation dashboard provides granular oversight of resolver permissions and subdomain assignments.

2. Name Resolution: From Human-Readable Name to Address

Resolution is the process of converting an ENS name to an Ethereum address. It happens entirely on-chain via a series of deterministic steps:

  1. Namehash computation: The name is normalized (lowercased, with certain characters disallowed) and then hashed recursively. For "alice.eth," the process is:
    node = keccak256(keccak256(keccak256(0x0, keccak256("eth")), keccak256("alice")).
    This produces a 256-bit identifier unique to the fully qualified name.
  2. Registry lookup: The ENS registry is called with the namehash. It returns the resolver contract address and the domain's owner. If the domain does not exist, the call reverts.
  3. Resolver query: The resolver's addr(bytes32 node) function is invoked. The public resolver stores a mapping of namehash → address. Custom resolvers can implement arbitrary logic—for example, returning different addresses based on the caller's identity.
  4. Reverse resolution: The ReverseRegistrar contract maps an Ethereum address back to a primary ENS name. This is how wallet UIs display "alice.eth" instead of a hex address.

The entire resolution typically costs 40,000–60,000 gas on Ethereum mainnet. Layer-2 networks like Arbitrum or Optimism reduce this to under 5,000 gas because resolver calls are batched with other transactions. Most wallets (MetaMask, Rainbow, Frame) cache resolution results locally to avoid repeating gas costs on every transaction.

3. Registration, Renewal, and Expiration Mechanics

The .eth registrar uses a "first-come, first-served" model with premium pricing for short names. Key parameters:

  • Registration duration: Minimum 1 year, maximum 100 years. Fees are linear with time—registering for 10 years costs 10× the annual rate.
  • Pricing tiers (as of 2025): 3-character names (e.g., "abc.eth") cost approximately $640/year. 4-character names cost $160/year. 5+ characters cost $5/year. Premium names from expired auctions are priced via a decreasing Dutch auction.
  • Renewal grace period: 90 days after expiration. During this window, only the previous owner can renew. After 90 days, the name enters a 21-day "premium period" where anyone can claim it by paying premium + registration fees. After that, standard registration rules apply.
  • Payment: All fees are paid in ETH. The registrar contract accepts direct payments or permit-based approvals. No fiat gateways exist natively—users must acquire ETH first.

Notably, ENS names are non-fungible tokens (ERC-721). This means they can be traded on marketplaces like OpenSea or Blur. However, the registrar contract retains the ability to transfer the name from the owner to a new buyer only if the buyer pays the required fees. In practice, secondary market prices often exceed registration costs for short or premium names. For collectors who view their ENS name as a valuable digital asset, managing it as an nft domain within a portfolio requires careful attention to renewal dates and metadata integrity.

4. Subdomains and Advanced Use Cases

ENS supports subdomains—names like "pay.alice.eth"—which are fully autonomous. The owner of "alice.eth" can create subdomains with different ownership, resolvers, and records. This enables:

  • Delegated subdomains: A company owning "company.eth" can assign "finance.company.eth" to a treasurer, who controls its records independently.
  • Wildcard resolution: With the WildcardResolver, any subdomain of a domain can resolve to the same address without explicit registration. For example, "*.alice.eth" could all point to Alice's wallet.
  • Off-chain resolution: The CCIP-Read protocol (EIP-3668) allows resolvers to fetch data from off-chain storage (e.g., IPFS or a centralized server) while still verifying it via an on-chain proof. This reduces gas costs for storing large records.

Subdomains are created by calling the registrar's setSubnodeOwner function. The parent domain owner pays the gas. Subdomains have no expiration—they exist as long as the parent domain remains registered. This makes them useful for permanent delegation, such as assigning "vitalik.eth" as a primary identifier for an organization.

5. Security, Risks, and Best Practices

ENS is generally secure, but users must understand three classes of risk:

  1. Registrar centralization: The .eth registrar is upgradable via the ENS DAO—a governance token (ENS) that allows holders to propose and vote on changes. While the DAO has been stable, a malicious proposal could theoretically alter registration terms. However, upgrades require a 4-week timelock, giving users time to migrate.
  2. Resolver trust: If you use a custom resolver, you must trust its code. A malicious resolver could return a different address for the same namehash—effectively hijacking your name. Always verify resolver source code on Etherscan.
  3. Phishing via similar names: Homoglyph attacks (e.g., "alice.eth" vs "alice.eth" with a Unicode replacement) are possible because ENS normalizes names via a limited character set. Always confirm the full namehash visually before sending funds.

Best practices include: enabling two-factor authentication on your wallet's seed phrase, using hardware wallets for domain registration, and never sharing resolver private keys. For enterprise users, the ability to freeze resolver records via a smart contract modifier prevents unauthorized changes even if the owner's wallet is compromised.

6. Integration with dApps and Wallets

ENS resolution is now standard in most Ethereum ecosystem tools:

  • Wallets: MetaMask, Rainbow, and Trust Wallet automatically resolve ENS names during send transactions. Users type "vitalik.eth" instead of a 42-character hex address.
  • DApps: Uniswap, Aave, and Compound use ENS for display and, in some cases, for permissioned functions (e.g., ENS-gated token claims).
  • IPFS content: ENS records can store an IPFS content hash. Opening "myblog.eth" in a browser like Brave or using the IPFS gateway automatically loads the associated website. This is the foundation of "decentralized web" hosting.
  • DNS integration: The ENS-EIP-2304 standard allows mapping traditional DNS names (e.g., "example.com" as an ENS name) by storing DNS records on-chain. This bridges Web2 and Web3 naming systems.

Interoperability continues to improve. As of 2025, all major EVM-compatible chains (Ethereum, Polygon, Optimism, Arbitrum, Base) support ENS resolution natively via cross-chain bridges like the L2 resolver. This means an ENS name registered on mainnet can resolve to an address on Arbitrum without re-registration.

7. Gas Costs and Optimization Strategies

ENS operations are not free. Typical gas costs (2025 mainnet averages):

  • Register a name: 150,000–200,000 gas (~$15–$30 at 50 gwei).
  • Set resolver records: 60,000–80,000 gas (~$6–$12).
  • Renew a name: 80,000–100,000 gas (~$8–$15).
  • Transfer a name: 50,000–70,000 gas (~$5–$10).

Optimization tactics include: batching multiple operations into a single transaction (e.g., register+set resolver+set address), using layer-2 networks for record updates, and scheduling renewals during low-gas periods (weekends at 00:00 UTC). The ENS Discord bot provides gas alerts for registered names approaching expiration. Additionally, the ens delegation dashboard allows authorized parties to manage renewals and records without exposing the domain owner's private key, reducing the risk of costly mistakes.

Conclusion

ENS domains represent a fundamental shift from centralized naming to user-controlled identity. By leveraging Ethereum's smart contract architecture, they provide a trustless, flexible, and extensible naming system that works across wallets, dApps, and chains. Understanding the registry-resolver-registrar triad, namehash computation, and renewal rules is essential for anyone building or relying on decentralized identity. As layer-2 adoption grows and CCIP-Read matures, ENS resolution costs will continue to drop, making it a practical choice for mainstream users.

For developers, the ENS SDK provides TypeScript bindings for all resolution functions. End-users benefit from wallet-level integration that abstracts away the technical complexity. Whether you register a name for personal use, as an investment, or to power a decentralized application, ENS offers a robust foundation—provided you manage its security and costs with the same diligence you apply to any smart contract interaction.

Further Reading & Sources

D
Devon McKenna

Guides, without the noise