> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/tools-terraform/docs/resources/dns_zone.md).

# ionoscloud\_dns\_zone

Creates and manages DNS Zone objects.

Manages a **DNS Zone**.

> ⚠️ Only tokens are accepted for authorization in the **ionoscloud\_dns\_zone** resource. Please ensure you are using tokens as other methods will not be valid.

## Example Usage

```hcl
resource "ionoscloud_dns_zone" "example" {
  name = "example.com"
  description = "description"
  enabled = false
}
```

## Argument reference

* `name` - (Required)\[string] The name of the DNS Zone. This property is immutable.
* `description` - (Optional)\[string] The description for the DNS Zone.
* `enabled` - (Optional)\[bool] Indicates if the DNS Zone is active or not. Default is `true`.

## Import

In order to import a DNS Zone, you can define an empty DNS Zone resource in the plan:

```hcl
resource "ionoscloud_dns_zone" "example" {
  
}
```

The resource can be imported using the `zone_id`, for example:

```shell
terraform import ionoscloud_dns_zone.example zone_id
```

In Terraform v1.12.0 and later, the [`import` block](https://developer.hashicorp.com/terraform/language/import) can also be used with the `identity` attribute:

```hcl
import {
  to = ionoscloud_dns_zone.example
  identity = {
    id = "zone_id"
  }
}

resource "ionoscloud_dns_zone" "example" {
  ### Configuration omitted for brevity ###
}
```

### Identity Schema

#### Required

* `id` (String) The UUID of the DNS Zone.

## Query (List Resource)

DNS Zones can be listed using `terraform query` (requires Terraform 1.14+). List blocks must be placed in a dedicated query file, whose name ends in `.tfquery.hcl` (for example `queries.tfquery.hcl`).

```hcl
list "ionoscloud_dns_zone" "all" {
  provider         = ionoscloud
  include_resource = true
}
```

See the [`ionoscloud_dns_zone` list resource documentation](https://docs.ionos.com/cloud/tools-terraform/docs/list-resources/dns_zone.md) for filters and the full attribute reference.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/tools-terraform/docs/resources/dns_zone.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
