> 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/api-reference/network-services/cloud-dns/zone-files/updates-a-zone-with-a-file.md).

# Updates a zone with a file

Updates a zone with zone file in BIND format (RFC 1035). All records in the zone are replaced with the ones provided.

```json
{"openapi":"3.0.3","info":{"title":"IONOS CLOUD - DNS API","version":"1.18.2"},"tags":[{"name":"ZoneFiles","description":"related to zone files"}],"servers":[{"url":"https://dns.de-fra.ionos.com","description":"Frankfurt"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.","name":"Authorization","in":"header"}},"schemas":{"RecordReadList":{"type":"object","required":["id","type","href","items","limit","_links"],"properties":{"id":{"type":"string","format":"uuid","description":"The resource's unique identifier.","readOnly":true},"type":{"type":"string","enum":["collection"]},"href":{"type":"string","format":"uri","readOnly":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/RecordRead"}},"offset":{"$ref":"#/components/schemas/Offset"},"limit":{"$ref":"#/components/schemas/Limit"},"_links":{"$ref":"#/components/schemas/Links"}}},"RecordRead":{"type":"object","required":["id","type","href","metadata","properties"],"properties":{"id":{"type":"string","format":"uuid","description":"The record ID (UUID).","readOnly":true},"type":{"type":"string","enum":["record"]},"href":{"type":"string","format":"uri","readOnly":true},"metadata":{"$ref":"#/components/schemas/MetadataWithStateFqdnZoneId"},"properties":{"$ref":"#/components/schemas/Record"}}},"MetadataWithStateFqdnZoneId":{"allOf":[{"$ref":"#/components/schemas/Metadata"},{"type":"object","required":["state","fqdn","zoneId"],"properties":{"state":{"$ref":"#/components/schemas/ProvisioningState"},"fqdn":{"type":"string","readOnly":true,"description":"A fully qualified domain name. FQDN consists of two parts - the hostname and the domain name."},"zoneId":{"$ref":"#/components/schemas/zoneId"}}}]},"Metadata":{"type":"object","description":"Metadata of the resource.","properties":{"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The creation date formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdBy":{"type":"string","description":"Unique name of the identity that created the resource.","readOnly":true},"createdByUserId":{"type":"string","description":"The unique ID of the user who created the resource.","readOnly":true},"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"lastModifiedBy":{"type":"string","description":"Unique name of the identity that created the resource.","readOnly":true},"lastModifiedByUserId":{"type":"string","description":"The unique ID of the user who last modified the resource.","readOnly":true},"resourceURN":{"type":"string","description":"Unique name of the resource.","readOnly":true}}},"ProvisioningState":{"type":"string","description":"The list of possible provisioning states in which DNS resource could be at the specific time.\n* AVAILABLE - resource exists and is healthy.\n* PROVISIONING - resource is being created or updated.\n* DESTROYING - delete command was issued, the resource is being deleted.\n* FAILED - creation of the resource failed.\n","enum":["PROVISIONING","DESTROYING","AVAILABLE","FAILED"]},"zoneId":{"type":"string","readOnly":true,"format":"uuid","description":"The ID (UUID) of the DNS zone of which record belongs to."},"Record":{"type":"object","required":["name","type","content"],"properties":{"name":{"type":"string","maxLength":253},"type":{"$ref":"#/components/schemas/RecordType"},"content":{"type":"string"},"ttl":{"type":"integer","default":3600,"minimum":60,"maximum":604800,"description":"Time to live for the record, recommended 3600."},"priority":{"type":"integer","default":3600,"minimum":0,"maximum":65535,"description":"Priority value is between 0 and 65535. Priority is mandatory for MX, SRV and URI record types and ignored for all other types."},"enabled":{"type":"boolean","default":true,"description":"When true - the record is visible for lookup."}}},"RecordType":{"type":"string","description":"Holds supported DNS resource record types. In the DNS context a record is a DNS resource record.","enum":["A","AAAA","CNAME","ALIAS","MX","NS","SRV","TXT","CAA","SSHFP","TLSA","SMIMEA","DS","HTTPS","SVCB","OPENPGPKEY","CERT","URI","RP","LOC"]},"Offset":{"type":"number","description":"Pagination offset.","readOnly":true},"Limit":{"type":"number","description":"Pagination limit.","readOnly":true},"Links":{"description":"URLs to navigate the different pages of results.\n","type":"object","properties":{"prev":{"description":"URL of the previous page; only present if offset is greater than\n0. Contains `offset` and `limit`; not returned when paging via\n`pagination.token`, which is forward-only.\n","type":"string","format":"uri","readOnly":true},"self":{"description":"URL of the current page. Contains `limit` plus either `offset` or\n`pagination.token`, depending on which pagination strategy the\nendpoint supports and the request used.\n","type":"string","format":"uri","readOnly":true},"next":{"description":"URL of the next page; only present if there are more elements to\nreturn. Contains `limit` plus either `offset` or\n`pagination.token`, depending on which pagination strategy the\nendpoint supports and the request used.\n","type":"string","format":"uri","readOnly":true}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotAllowed":{"description":"### Not Allowed\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ConflictInZonefileImport":{"description":"### Conflict Error\nThe zone file cannot be imported because it contains a duplicate record.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"### Unprocessable Entity\nThe request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/zones/{zoneId}/zonefile":{"put":{"operationId":"zonesZonefilePut","summary":"Updates a zone with a file","tags":["ZoneFiles"],"description":"Updates a zone with zone file in BIND format (RFC 1035). All records in the zone are replaced with the ones provided.","parameters":[{"name":"zoneId","in":"path","schema":{"type":"string","format":"uuid"},"required":true,"description":"The ID (UUID) of the DNS zone."}],"requestBody":{"description":"Zone file in BIND format (RFC 1035). In order to support import files from other sources, the bind zone file can contain SOA and NS records, but these records will be ignored.","required":true,"content":{"text/plain":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordReadList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/NotAllowed"},"409":{"$ref":"#/components/responses/ConflictInZonefileImport"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```


---

# 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/api-reference/network-services/cloud-dns/zone-files/updates-a-zone-with-a-file.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.
