---
title: "Add DNS Record"
method: PUT
path: "/dnszone/{zoneId}/records"
tags: ["DNS Zone"]
---

# Add DNS Record

`PUT /dnszone/{zoneId}/records`

## Path parameters

- `zoneId` integer, required

## Request body

- AddDnsRecordModel
  - `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 = PullZone 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 record was successfuly added.

- DnsRecordModel
  - `Id` integer
  - `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 = PullZone 8 = SRV 9 = CAA 10 = PTR 11 = Script 12 = NS 13 = SVCB 14 = HTTPS 15 = TLSA
  - `Ttl` integer
  - `Value` string, nullable
  - `Name` string, nullable
  - `Weight` integer
  - `Priority` integer
  - `Port` integer
  - `Flags` integer
  - `Tag` string, nullable
  - `Accelerated` boolean
  - `AcceleratedPullZoneId` integer
  - `LinkName` string, nullable
  - `IPGeoLocationInfo` GeoDnsLocationModel
    - `CountryCode` string, nullable — The ISO country code of the location
    - `Country` string, nullable — The name of the country of the location
    - `ASN` integer — The ASN of the IP organization
    - `OrganizationName` string, nullable — The mame of the organization that owns the IP
    - `City` string, nullable — The name of the city of the location
  - `GeolocationInfo` DnsRecordGeoLocationInfo
    - `Country` string, nullable
    - `City` string, nullable
    - `Latitude` number, double
    - `Longitude` number, double
  - `MonitorStatus` 0 | 1 | 2 — 0 = Unknown 1 = Online 2 = Offline
  - `MonitorType` 0 | 1 | 2 | 3 — 0 = None 1 = Ping 2 = Http 3 = Monitor
  - `GeolocationLatitude` number, double
  - `GeolocationLongitude` number, double
  - `EnviromentalVariables` DnsRecordEnviromentalVariableModel[], nullable
    - `Name` string, nullable
    - `Value` string, nullable
  - `LatencyZone` string, nullable
  - `SmartRoutingType` 0 | 1 | 2 — 0 = None 1 = Latency 2 = Geolocation
  - `Disabled` boolean
  - `Comment` string, nullable
  - `AutoSslIssuance` boolean
  - `AccelerationStatus` 0 | 1 | 2 | 3 | 4 — 0 = None 1 = Pending 2 = Processing 3 = Completed 4 = Failed

## Other responses

- `400` — Failed adding the DNS record. Model validation failed.
- `401` — The request authorization failed
- `404` — The DNS Zone with the requested ID does not exist.
- `500` — Internal Server Error

---

[API](https://skmtc.net/bunny/apis/bunny-net-cdn-logging.md) · [All operations](https://skmtc.net/bunny/apis/bunny-net-cdn-logging/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bunny/bunny-net-cdn-logging/revisions/9e622620664b/schema)
