Skip to content

Domain By Name

Load a domain by interpreted name, including v1/v2 discriminated fields and subregistry on ENSv2.
Run in ENSAdmin
query DomainByName($name: InterpretedName!) {
  domain(by: {name: $name}) {
    __typename
    id
    label { interpreted hash }
    canonical { name node path { id } }
    owner { address }
    subregistry { contract { chainId address } }

    ... on ENSv1Domain {
      rootRegistryOwner { address }
    }
  }
}
{
  "name": "test-name.eth"
}
{
  "data": {
    "domain": {
      "__typename": "ENSv2Domain",
      "id": "eip155:11155111/erc1155:0x796fff2e907449be8d5921bcc215b1b76d89d080/18650549467948381174706470291653511222307197070371999253038345217664991887360",
      "label": {
        "interpreted": "test-name",
        "hash": "0x293bd640008c5863fbe17a08ae5df5b2484357f5dc95e0fdd089f85e7edbfe5a"
      },
      "subregistry": null,
      "owner": {
        "address": "0x205d2686da3bf33f64c17f21462c51b5ead462cf"
      },
      "name": "test-name.eth"
    }
  }
}
# POST JSON to your ENSNode Omnigraph endpoint (same path enssdk uses).
curl -sS -X POST "https://api.v2-sepolia.ensnode.io/api/omnigraph" \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "query": "query DomainByName($name: InterpretedName!) { domain(by: {name: $name}) { __typename id label { interpreted hash } canonical { name node path { id } } owner { address } subregistry { contract { chainId address } } ... on ENSv1Domain { rootRegistryOwner { address } } } }",
  "variables": {
    "name": "test-name.eth"
  }
}
EOF
ENS Omnigraph GraphQL
query DomainByName($name: InterpretedName!) {
domain(by: {name: $name}) {
__typename
id
label { interpreted hash }
canonical { name node path { id } }
owner { address }
subregistry { contract { chainId address } }
... on ENSv1Domain {
rootRegistryOwner { address }
}
}
}

Payload and transport examples

{
"name": "test-name.eth"
}

Response is an illustrative snapshot; live data depends on your ENSNode instance. The curl tab shows a POST to https://api.v2-sepolia.ensnode.io/api/omnigraph

Back to Examples