How DNS Integration Works
The DNS integration system allows DNS domain owners to:- Prove ownership of a DNS domain using DNSSEC
- Claim the corresponding ENS name
- Set resolver and address records
Key Components
The DNS integration system consists of several key contracts:DNSRegistrar
The main contract that enables claiming DNS names in ENS. It verifies DNSSEC proofs and creates ENS records for proven DNS domains. Location:contracts/dnsregistrar/DNSRegistrar.sol
DNSSEC Oracle
Validates DNSSEC proofs by checking cryptographic signatures against trusted anchors. This ensures that only legitimate DNS owners can claim names. Location:contracts/dnssec-oracle/DNSSECImpl.sol
OffchainDNSResolver
Enables offchain DNS resolution through CCIP-Read, allowing ENS to resolve DNS records without storing all data onchain. Location:contracts/dnsregistrar/OffchainDNSResolver.sol
PublicSuffixList
Defines which top-level domains and public suffixes can be claimed through the DNS registrar. Location:contracts/dnsregistrar/PublicSuffixList.sol
DNSSEC Validation
DNSSEC provides cryptographic authentication for DNS records. The validation process:- Trust Anchors: The DNSSEC oracle is initialized with root trust anchors
- Chain of Trust: Proofs form an unbroken chain from the root to the claimed domain
- Signature Verification: Each record’s signature is verified using public keys from the parent zone
- Timestamp Validation: Signatures must be valid at the current time
Claiming Process
To claim a DNS name in ENS:Step 1: Create DNS TXT Record
Add a TXT record to your DNS domain at_ens.yourdomain.com:
Step 2: Submit DNSSEC Proof
CallproveAndClaim with the DNS name and a chain of signed DNSSEC records:
Step 3: Claim is Validated
The DNSRegistrar:- Verifies the DNSSEC proof through the oracle
- Checks that the domain is a valid public suffix
- Extracts the owner address from the TXT record
- Creates the ENS record with the specified owner
Public Suffix List
The Public Suffix List determines which domains can be claimed. Only domains under recognized public suffixes (like.com, .org, .net) can be registered.
com itself.
Owner Record Format
The TXT record at_ens.yourdomain.com must follow this format:
Advanced: Claiming with Resolver
You can claim a name and set a resolver in a single transaction:- Claim the DNS name
- Set a custom resolver
- Set an address record (if resolver is provided)
Stale Proof Protection
The registrar tracks the inception time of proofs to prevent replay attacks:Events
The DNSRegistrar emits events for important actions:Security Considerations
DNSSEC Trust
The security of DNS claims depends on:- The integrity of DNSSEC root trust anchors
- Proper DNSSEC signing of the DNS zone
- Secure algorithm and digest implementations
Proof Freshness
Old DNSSEC signatures can be replayed. The inception tracking helps mitigate this, but domains should use reasonable signature validity periods.Public Suffix Validation
Only enable public suffixes that are widely recognized and properly managed. Incorrect suffix configuration could allow improper claims.Related Contracts
- DNSRegistrar - Main claiming contract
- DNSSEC Oracle - Signature verification