> 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/network-services/cloud-dns/api-how-tos/import-dns-zone.md).

# Import a DNS Zone

IONOS Cloud DNS: import an existing primary DNS zone from another provider using a PUT request

You can import a primary zone from your existing DNS provider to <code class="expression">space.vars.ionos\_cloud</code>.

{% hint style="info" %}
**Prerequisite** You need an <code class="expression">space.vars.ionos\_cloud</code> account with API credentials configured with the appropriate permissions.
{% endhint %}

To import an existing primary zone to Cloud DNS, follow these steps:

1\. Create a primary zone without records.

2\. Perform a PUT request providing the zoneId of the newly created primary zone and the zone file.

{% hint style="success" %}
**Result:** On a successful PUT request, the records provided in the zone file will be added to your primary zone.
{% endhint %}

{% hint style="info" %}
**Important:** If the zone file you import contains CNAME entries that point to names in another private zone, Azure DNS resolution of the CNAME will fail unless the other private zone is imported or the CNAME entries are modified.
{% endhint %}

## Request

```bash
curl --location --request PUT 'https://dns.de-fra.ionos.com/zones/42b21ce3-6fc7-44af-b0c9-2aaadbf2b333/zonefile' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--data-raw '$ORIGIN example.com.
www 60  IN  A   1.2.3.4
shop    60  IN  CNAME   app.example.com.'
```

## Response

**200 Successful operation**

```json
{
  "id": "42b21ce3-6fc7-44af-b0c9-2aaadbf2b333",
  "type": "collection",
  "href": "<RESOURCE-URI>",
  "items": [
    {
      "id": "d6ba6fc1-fc82-4f0c-b030-2638778e0bef",
      "type": "record",
      "href": "<RESOURCE-URI>",
      "metadata": {
        "createdDate": "2022-08-21T15:52:53Z",
        "createdBy": "ionos:iam:cloud:31960002:users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedDate": "2022-08-21T15:52:53Z",
        "lastModifiedBy": "ionos:iam:cloud:31960002:users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedByUserId": "63cef532-26fe-4a64-a4e0-de7c8a506c90",
        "resourceURN": "ionos:<product>:<location>:<contract>:<resource-path>",
        "state": "PROVISIONING",
        "fqdn": "app.example.com",
        "zoneId": "a363f30c-4c0c-4552-9a07-298d87f219bf"
      },
      "properties": {
        "name": "app",
        "type": "A",
        "content": "192.0.2.2",
        "ttl": 3600,
        "priority": 0,
        "enabled": true
      }
    }
  ],
  "offset": 0,
  "limit": 1000,
  "_links": {
    "prev": "http://PREVIOUS-PAGE-URI",
    "self": "http://THIS-PAGE-URI",
    "next": "http://NEXT-PAGE-URI"
  }
}
```

## Zone file

The imported file has to be in BIND format, a widely used format supported by most DNS software, including the popular BIND DNS server.

The file should include all the record types associated with the selected primary zone. The Start of Authority (SOA) and Name Server (NS) records are not to be considered since <code class="expression">space.vars.ionos\_cloud</code> uses its name server configuration.


---

# 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/network-services/cloud-dns/api-how-tos/import-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.
