Metro Echo

ens cloudflare

How ENS Cloudflare Works: Everything You Need to Know

June 16, 2026 By Rowan Park

Introduction to ENS and Cloudflare Integration

The Ethereum Name Service (ENS) maps human-readable names like "alice.eth" to Ethereum addresses, IPFS content hashes, and other machine-readable identifiers. Cloudflare, a leading content delivery network (CDN) and DNS provider, has developed a gateway that resolves ENS domains over HTTPS using standard DNS protocols. This integration allows any web browser or application to access decentralized content hosted on ENS without requiring a browser extension or blockchain node. The core mechanism relies on DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT), which Cloudflare’s 1.1.1.1 resolver supports natively. When a user queries an ENS domain, Cloudflare’s resolver performs a DNSSEC-validated lookup against the ENS registry on the Ethereum mainnet, then returns the corresponding IPFS hash or Ethereum address as a DNS record. This process eliminates the need for specialized software, making ENS-accessible content available to billions of users worldwide.

The architecture is built on three layers: the ENS smart contract registry on Ethereum, Cloudflare’s distributed resolver network, and the user’s application. The resolver translates the ENS name into a DNS query, typically for a TXT or AAAA record. Cloudflare’s infrastructure caches these responses, reducing latency for repeated queries. This caching behavior is critical for performance: ENS lookups that would normally take 15–30 seconds (due to Ethereum block times) are reduced to sub-100 milliseconds after the first query. The system also supports subname delegation, allowing ENS name owners to grant specific permissions to subdomains (e.g., "blog.alice.eth") without compromising the parent domain’s security. For advanced deployment patterns, refer to Web3 Identity Enhancement Suggestions for granular control over subname resolution policies.

Architecture: DNS Resolution for ENS Domains

Cloudflare’s ENS resolution pipeline operates as follows:

  1. Query initiation: A user’s browser sends a DNS query (e.g., "app.alice.eth") to Cloudflare’s 1.1.1.1 resolver over DoH or DoT.
  2. ENS lookup: The resolver checks its cache. If absent, it queries the Ethereum mainnet via an ENS gateway (a Cloudflare-run node or a third-party provider like Infura). The gateway calls the ENS registry contract (0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e) to resolve the name hash.
  3. Record retrieval: The resolver obtains the resolver contract address from the registry, then calls the resolver’s text() or addr() function to fetch the target data (e.g., an IPFS CID for a website, or an Ethereum address for payments).
  4. Response translation: The gateway maps the ENS data to standard DNS record types. IPFS CIDs are converted to DNS TXT records with a special prefix (e.g., dnslink=/ipfs/Qm...). Ethereum addresses are returned as AAAA records with a synthetic IPv6 mapping (e.g., a.b.c.d.e.f representing the address).
  5. Caching and delivery: The response is cached at Cloudflare’s edge for a configurable TTL (typically 300 seconds for ENS records). The resolver returns the DNS response to the user’s application, which processes it to load content from IPFS or interact with a smart contract.

This architecture avoids exposing the user’s IP address to the Ethereum network, enhancing privacy. Cloudflare also performs DNSSEC validation on the ENS gateway response to prevent spoofing. The system supports wildcard subdomains through ENS’s setSubnodeRecord function, enabling scalable delegation patterns.

Subname Delegation and Use Cases

ENS subnames are a powerful feature that allows domain owners to create hierarchies (e.g., "pay.alice.eth", "vault.alice.eth"). Cloudflare’s ENS resolver supports these subnames natively, provided the parent domain’s resolver contract is configured to return records for arbitrary subdomains. The delegation works through an ENS record called contenthash, which can point to an IPNS key or a subdomain-specific IPFS CID. For example, an owner can set contenthash on "blog.alice.eth" to a different IPFS hash than "alice.eth", enabling separate sites under the same top-level domain. Cloudflare’s caching layer treats each subname as an independent DNS record, so "blog.alice.eth" and "alice.eth" can have different TTLs and cache behaviors.

Practical use cases include decentralized web hosting, where each subname serves a distinct IPFS site; digital identity verification, where subnames hold verifiable credentials; and multi-signature wallet management, where subnames correspond to different security tiers. To implement advanced subname strategies like time-bound delegation or access control lists, explore the ENS unlock subname documentation, which details smart contract interactions for granular permissioning.

Performance Metrics and Tradeoffs

Cloudflare’s ENS resolution introduces specific performance characteristics compared to traditional DNS or on-chain queries:

  • First-byte time: Uncacheable ENS lookups take 5–10 seconds (Ethereum block inclusion time plus transaction confirmation). Cloudflare’s edge cache reduces subsequent queries to 5–20 ms.
  • Cache hit ratio: For popular ENS domains (e.g., "vitalik.eth"), Cloudflare reports a 95%+ cache hit rate, meaning only 5% of queries reach the Ethereum gateway.
  • Bandwidth overhead: Each ENS resolution requires approximately 200 bytes of DNS payload (including the DNSSEC signature and Ethereum proof). This is 40% larger than standard DNS responses but negligible for most applications.
  • Latency by region: Cloudflare’s 330+ global PoPs ensure that ENS queries from Asia, Europe, or North America have similar latency (50–100 ms to the edge). However, Ethereum gateway calls are processed in Cloudflare’s US-based data centers, adding 100–200 ms for non-US users during cache misses.

Tradeoffs include reliance on Cloudflare’s infrastructure for resolution—if Cloudflare’s Ethereum gateway goes offline, ENS resolution fails for all users relying on 1.1.1.1. Additionally, Cloudflare’s caching policy means that ENS record updates take up to 5 minutes to propagate globally, which may be unacceptable for time-sensitive applications (e.g., emergency contract upgrades). For such cases, direct Ethereum node queries remain necessary.

Security Considerations and Best Practices

Cloudflare’s ENS resolver uses DNSSEC to authenticate responses from the ENS gateway, but this does not protect against Ethereum-level attacks (e.g., reorgs or contract exploits). Users should:

  1. Verify that the ENS domain’s resolver contract is audited and immutable. Malicious contract upgrades could redirect queries to attacker-controlled IPFS content.
  2. Use Cloudflare’s HTTPS-only mode to encrypt the path between the resolver and the user’s application. Unencrypted DNS-over-UDP queries leak the ENS domain being resolved.
  3. Monitor the records.ttl field in Cloudflare’s ENS API. A TTL longer than 600 seconds increases the attack window for stale content serving.
  4. Implement subname locks via smart contracts to prevent unauthorized delegation changes. The ENS unlock subname mechanism allows owners to set time-locks on subname updates, mitigating front-running attacks.
  5. Test ENS resolution failures: Cloudflare’s resolver returns a SERVFAIL error if the Ethereum gateway times out (after 10 seconds). Applications should have fallback resolution paths (e.g., direct Ethereum RPC calls) for critical services.

Future Developments and Alternatives

Cloudflare is actively developing an ENS gateway API that returns raw Ethereum proofs, enabling client-side verification without trusting Cloudflare. This will reduce the trust assumption to “Cloudflare correctly relays the Ethereum proof” rather than “Cloudflare correctly resolves the ENS name.” The proof-based system is scheduled for Q3 2025 and will support EIP-3668 (CCIP Read) for transparent verification. Alternative ENS gateways include:

  • Etherscan ENS Gateway: Free but rate-limited to 10 requests/second, no caching.
  • Infura ENS Gateway: Supports IPFS resolution and custom RPC endpoints, but requires an API key.
  • Self-hosted gateway (Ethereum node + dnsmasq): Full control but high operational cost (syncing Ethereum mainnet requires 12 TB storage).
Cloudflare’s advantage lies in its global edge network (270 Tbps capacity) and zero-cost access for basic queries. For enterprise use, Cloudflare offers dedicated ENS resolver instances with custom caching TTLs and SLA guarantees (99.9% uptime). The integration of ENS with Cloudflare Workers also permits server-side ENS resolution for dynamic content generation, opening possibilities for personalized Web3 experiences.

Learn how ENS Cloudflare integrates blockchain naming with CDN security. Understand architecture, DNS-over-HTTPS, caching, and subname delegation.

In short: Learn more about ens cloudflare
Featured Resource

How ENS Cloudflare Works: Everything You Need to Know

Learn how ENS Cloudflare integrates blockchain naming with CDN security. Understand architecture, DNS-over-HTTPS, caching, and subname delegation.

Background & Citations

R
Rowan Park

Your source for daily coverage