> 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-ansible/api/dns/modules/dns_secondary_zone.md). Agents can also search and read this documentation through its [MCP server](https://docs.ionos.com/cloud/~gitbook/mcp).

# Secondary Zone

## dns\_secondary\_zone

This is a module that supports creating, updating or destroying DNS Secondary Zones

### Example Syntax

```yaml

name: Create Secondary Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  name: 'test.example.test.ansible.com'
  description: 'test_description'
  primary_ips: ''
register: zone_response


name: Update Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  description: 'zone_description_updated'
  primary_ips: ''
  allow_replace: false
  state: update
register: updated_zone_response


name: Transfer Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  wait: false
  state: transfer


name: Delete Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  wait: true
  state: absent

```

&#x20; &#x20;

### Returned object

```json
{
    "changed": false,
    "failed": false,
    "action": "create",
    "secondary_zone": {
        "id": "bb1a4664-0f79-57e2-85ff-36c22b164884",
        "type": "secondaryzone",
        "href": "/secondaryzones/bb1a4664-0f79-57e2-85ff-36c22b164884",
        "metadata": {
            "last_modified_date": "2023-10-25T14:26:17+00:00",
            "created_date": "2023-10-25T14:26:17+00:00",
            "state": "AVAILABLE",
            "nameservers": [
                "<NAMESERVER1>",
                "<NAMESERVER2>",
                "<NAMESERVER3>",
                "<NAMESERVER4>"
            ]
        },
        "properties": {
            "zone_name": "<ZONE_NAME>",
            "description": "test_description",
            "primary_ips": [
                "<IP1>",
                "<IP2>"
            ]
        }
    }
}

```

#### For more examples please check out the tests [here](https://github.com/ionos-cloud/module-ansible/tree/master/tests/dns).

&#x20;

&#x20;

## state: **present**

```yaml
  
name: Create Secondary Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  name: 'test.example.test.ansible.com'
  description: 'test_description'
  primary_ips: ''
register: zone_response

```

#### Available parameters for state **present**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>name<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The zone name</td></tr><tr><td>description<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The hosted zone is used for...</td></tr><tr><td>primary_ips<br><mark style="color:blue;">list</mark></td><td align="center">False</td><td>Indicates IP addresses of primary nameservers for a secondary zone. Accepts IPv4 and IPv6 addresses</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update', 'transfer']</td></tr></tbody></table>

&#x20;

&#x20;

## state: **absent**

```yaml
  
name: Delete Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  wait: true
  state: absent

```

#### Available parameters for state **absent**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>secondary_zone<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID or name of an existing Secondary Zone.</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update', 'transfer']</td></tr></tbody></table>

&#x20;

&#x20;

## state: **update**

```yaml
  
name: Update Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  description: 'zone_description_updated'
  primary_ips: ''
  allow_replace: false
  state: update
register: updated_zone_response

```

#### Available parameters for state **update**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>name<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The zone name</td></tr><tr><td>description<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The hosted zone is used for...</td></tr><tr><td>primary_ips<br><mark style="color:blue;">list</mark></td><td align="center">False</td><td>Indicates IP addresses of primary nameservers for a secondary zone. Accepts IPv4 and IPv6 addresses</td></tr><tr><td>secondary_zone<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID or name of an existing Secondary Zone.</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update', 'transfer']</td></tr></tbody></table>

&#x20;

&#x20;

## state: **transfer**

```yaml
  
name: Transfer Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  wait: false
  state: transfer

```

#### Available parameters for state **transfer**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>secondary_zone<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID or name of an existing Secondary Zone.</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update', 'transfer']</td></tr></tbody></table>

&#x20;

&#x20;


---

# 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-ansible/api/dns/modules/dns_secondary_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.
