# Subdomain Distribution

### Subdomain Design <a href="#design" id="design"></a>

The `ZNSSubRegistrar` contract is used for registering and managing subdomains. It connects to the `ZNSRootRegistrar` to settle the most crucial domain data (owner, resolver, NFT) and stores subdomain distribution data (pricing, payment, access option) on itself.&#x20;

The `ZNSRootRegistrar` calls the `ZNSSubRegistrar` to get distribution data for root domains as well as to set this data for newly registered root domains.

Every root domain or subdomain in the chain is a potential parent for subdomain distribution and can set its own configs and rules for this. These configs can be changed or turned off at any time by the owner of the relevant domain.

### Distribution

A domain of any level in ZNS supports issuing subdomains. The rules and the availability of subdomains for a certain domain of any level depends on the rules set by the owner of the parent domain. As written in the [Domain Registration](/zns/domain-registration.md) section, parts of the full distribution configuration (excluding pricing) can be set right in the registration transaction. In v2 all of this data could be optionally provided at the time of registration to fully set up a domain with full set of distribution data in one transaction.

There are several necessary configs that need to be set by the domain owner to fully turn on subdomain distribution. They are further detailed in [Base Distribution Configuration](/zns/subdomain-distribution/base-distribution-configuration.md).


---

# 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://zer0-1.gitbook.io/zns/subdomain-distribution.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.
