Comment on page

ENS Tables

Ethereum Name Service (ENS) tables available to query via SQL

Ethereum Name Service (ENS) tables

Table Name
A mapping of ENS names to addresses
The columns and their schema available for each table can be viewed with the describe <table> command. For example:
/* Show the columns available */
User can query this table by ENS domain name to retrieve the latest owner and eth_address information. Supported names are:
  • Top Level Domains (.eth)
  • Subdomains
    • dcl.eth
    • loopring.eth
    • earth.eth
    • auth.eth
This table can be used, for example, to retrieve the Ethereum address associated with a *.eth domain or subdomain:
SELECT * FROM WHERE name='spiceai.eth'
Or to infer the domain name of an address (reverse look-up):
SELECT * FROM WHERE eth_address='0x425ec049c2a4722edfd770ab7bc4f9ca8b7bd815'
Expiration dates in the expires column are given as Unix timestamps. They can be null for entities such as subdomains, which do not necessarily have expiry dates. We currently do not track expiration dates of NameWrapper subdomains.

Improving query performance - indexed columns

Query performance can be significantly improved by adding WHERE clauses to your query on specific indexed columns.
Table Name
Indexed Columns
name, eth_address