---
title: "Add DNS Zone"
method: POST
path: "/dnszone"
tags: ["DNS Zone"]
---

# Add DNS Zone

`POST /dnszone`

## Request

- Base URL: `https://api.bunny.net`
- URL: `https://api.bunny.net/dnszone`
- Auth: API key in header `AccessKey`
- TypeScript: <https://skmtc.dev/bunny/apis/bunny-net-api/docs/dnszone/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- DnsZoneAddModel
  - `Domain` string, required: The domain that will be added.
  - `Records` AddDnsRecordModel[], nullable: Optional array of DNS records to add when creating the zone.
    - `Type` 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15: 0 = A 1 = AAAA 2 = CNAME 3 = TXT 4 = MX 5 = Redirect 6 = Flatten 7 = Pull Zone 8 = SRV 9 = CAA 10 = PTR 11 = Script 12 = NS 13 = SVCB 14 = HTTPS 15 = TLSA
    - `Ttl` integer, nullable
    - `Value` string, nullable
    - `Name` string, nullable
    - `Weight` integer, nullable
    - `Priority` integer, nullable
    - `Flags` integer, nullable
    - `Tag` string, nullable
    - `Port` integer, nullable
    - `PullZoneId` integer, nullable
    - `ScriptId` integer, nullable
    - `Accelerated` boolean, nullable
    - `MonitorType` 0 | 1 | 2 | 3: 0 = None 1 = Ping 2 = HTTP 3 = Monitor
    - `GeolocationLatitude` number, double, nullable
    - `GeolocationLongitude` number, double, nullable
    - `LatencyZone` string, nullable
    - `SmartRoutingType` 0 | 1 | 2: 0 = None 1 = Latency 2 = Geolocation
    - `Disabled` boolean, nullable
    - `EnviromentalVariables` DnsRecordEnviromentalVariableModel[], nullable
      - `Name` string, nullable
      - `Value` string, nullable
    - `Comment` string, nullable
    - `AutoSslIssuance` boolean, nullable

## Response `201`

The DNS Zone was successfully added

## Other responses

- `400`: Failed adding the DNS Zone. Model validation failed
- `401`: The request authorization failed
- `500`: Internal Server Error

---

[API](https://skmtc.dev/bunny/apis/bunny-net-api.md) - [All operations](https://skmtc.dev/bunny/apis/bunny-net-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bunny/apis/bunny-net-api/revisions/2b06f94dbfbf?raw)
