# ENSSubdomainRegistrar

## contract ENSSubdomainRegistrar

is [AragonApp](/developers/tools/aragonos/smart-contract-references/apps/aragonapp.md), [ENSConstants](/developers/tools/aragonos/smart-contract-references/ens/ensconstants.md)

Source: [contracts/ens/ENSSubdomainRegistrar.sol](https://github.com/aragon/aragonOS/blob/v4.4.0/contracts/ens/ENSSubdomainRegistrar.sol)

## Index

* [DeleteName](#deletename)
* [NewName](#newname)
* [\_createName](#_createname)
* [\_pointToResolverAndResolve](#_pointtoresolverandresolve)
* [createName](#createname)
* [createNameAndPoint](#createnameandpoint)
* [deleteName](#deletename-1)
* [getAddr](#getaddr)
* [getNodeForLabel](#getnodeforlabel)
* [initialize](#initialize)
* [pointRootNode](#pointrootnode)

## Reference

### Events

#### **DeleteName** <a href="#deletename" id="deletename"></a>

` event`` `` `**`DeleteName`**`(bytes32 node, bytes32 label)`

***

Parameters:

* `node` - bytes32
* `label` - bytes32

#### **NewName** <a href="#newname" id="newname"></a>

` event`` `` `**`NewName`**`(bytes32 node, bytes32 label)`

***

Parameters:

* `node` - bytes32
* `label` - bytes32

### Functions

#### **\_createName** <a href="#createname" id="createname"></a>

` function`` `` `**`_createName`**`(bytes32 _label, address _owner) internal returns (bytes32)`

***

Parameters:

* `_label` - bytes32
* `_owner` - address

Returns:

* bytes32

#### **\_pointToResolverAndResolve** <a href="#pointtoresolverandresolve" id="pointtoresolverandresolve"></a>

` function`` `` `**`_pointToResolverAndResolve`**`(bytes32 _node, address _target) internal`

***

Parameters:

* `_node` - bytes32
* `_target` - address

#### **createName** <a href="#createname" id="createname"></a>

` function`` `` `**`createName`**`(bytes32 _label, address _owner) external returns (bytes32)`

***

Create a new ENS subdomain record for \`\_label\` and assign ownership to \`\_owner\`.

Modifiers:

* [auth](/developers/tools/aragonos/smart-contract-references/apps/aragonapp.md#authp)

Parameters:

* `_label` - Label of new subdomain
* `_owner` - Owner of new subdomain

Returns:

* node Hash of created node

#### **createNameAndPoint** <a href="#createnameandpoint" id="createnameandpoint"></a>

` function`` `` `**`createNameAndPoint`**`(bytes32 _label, address _target) external returns (bytes32)`

***

Create a new ENS subdomain record for \`\_label\` that resolves to \`\_target\` and is owned by this ENSSubdomainRegistrar.

Modifiers:

* [auth](/developers/tools/aragonos/smart-contract-references/apps/aragonapp.md#authp)

Parameters:

* `_label` - Label of new subdomain
* `_target` - Ethereum address this new subdomain label will point to

Returns:

* node Hash of created node

#### **deleteName** <a href="#deletename" id="deletename"></a>

` function`` `` `**`deleteName`**`(bytes32 _label) external`

***

Deregister ENS subdomain record for \`\_label\`.

Modifiers:

* [auth](/developers/tools/aragonos/smart-contract-references/apps/aragonapp.md#authp)

Parameters:

* `_label` - Label of subdomain to deregister

#### **getAddr** <a href="#getaddr" id="getaddr"></a>

` function`` `` `**`getAddr`**`(bytes32 node) internal view returns (address)`

***

Parameters:

* `node` - bytes32

Returns:

* address

#### **getNodeForLabel** <a href="#getnodeforlabel" id="getnodeforlabel"></a>

` function`` `` `**`getNodeForLabel`**`(bytes32 _label) internal view returns (bytes32)`

***

Parameters:

* `_label` - bytes32

Returns:

* bytes32

#### **initialize** <a href="#initialize" id="initialize"></a>

` function`` `` `**`initialize`**`(AbstractENS _ens, bytes32 _rootNode) public`

***

Initialize can only be called once. It saves the block number in which it was initialized. This contract must be the owner of the \`\_rootNode\` node so that it can create subdomains. Initialize this ENSSubdomainRegistrar instance with \`\_ens\` as the root ENS registry and \`\_rootNode\` as the node to allocate subdomains under.

Modifiers:

* [onlyInit](/developers/tools/aragonos/smart-contract-references/common/initializable.md#getinitializationblock)

Parameters:

* `_ens` - Address of ENS registry
* `_rootNode` - Node to allocate subdomains under

#### **pointRootNode** <a href="#pointrootnode" id="pointrootnode"></a>

` function`` `` `**`pointRootNode`**`(address _target) external`

***

Resolve this ENSSubdomainRegistrar's root node to \`\_target\`.

Modifiers:

* [auth](/developers/tools/aragonos/smart-contract-references/apps/aragonapp.md#authp)

Parameters:

* `_target` - Ethereum address root node will point to


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://legacy-docs.aragon.org/developers/tools/aragonos/smart-contract-references/ens/enssubdomainregistrar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
