Skip to content

DNS

OAuth scopes: reads require dns:read, writes require dns:write.

DNS Zones

List DNS Zones

This is not account scoped and will return ALL dns zones this user has access to.

GET /api/dns_zones

Params (optional)
  • page: Integer | page number (default: 1)
  • per_page: Integer | records per page (default: 50, max: 100)
Returned Params
  • dns_zone: Array
    • id: String
    • name: String
    • dnssec: Boolean
    • dnssec_data: Object (nil if dnssec = false)
    • created_at: DateTime
    • updated_at: DateTime
    • account: Object
      • id: String
      • name: String

View a Zone

GET /api/dns_zones/:id

Returned Params
  • dns_zone: Object
    • id: String
    • name: String
    • dnssec: Boolean
    • dnssec_data: Object (nil if dnssec = false)
      • Enabled: Boolean
      • DsRecord: String
      • Digest: String
      • DigestType: String
      • Algorithm: Integer
      • PublicKey: String
      • KeyTag: Integer
      • Flags: Integer
      • DsConfigured: Boolean
    • created_at: DateTime
    • updated_at: DateTime
    • account: Object
      • id: String
      • name: String
    • records: Array
      • id: String
      • record_type: Integer
      • ttl: Integer
      • value: String
      • name: String
      • priority: Integer
      • port: Integer
      • flags: String
      • record_tag: String
      • comment: String
      • site: Object | If a pull zone (record_type == 7)
        • id: String
        • name: String
        • created_at: DateTime
        • updated_at: DateTime
        • primary_domain: String
        • location: String
        • package: String
      • created_at: DateTime
      • updated_at: DateTime
    • nameservers: Array

Enable / Disable DNSSEC

PATCH /api/dns_zones/:id

Params
  • dns_zone: Object
    • dnssec: Boolean

Returns the same as show.


Create a DNS Zone

Account Scope Required, please include X-Auth-Account header with your Account ID — the zone's account comes from the request's account context. Only name is accepted.

POST /api/dns_zones

Params
  • dns_zone: Object
    • name: String
Errors
  • 400 {"errors":["Missing X-Auth-Account"]} | header absent
  • 403 {"errors":["Not Authorized"]} | no edit access to the account
  • 422 | zone invalid (see errors array)

Returns the same as show.


Delete Zone

DELETE /api/dns_zones/:id

Returns 202.


DNS Query Statistics

Queries-served stats for a Bunny DNS zone, formatted for charting.

GET /api/dns_zones/:id/dns_stats

Params (optional)
  • date_from: String | ISO8601 datetime (default: 14 days ago)
  • date_to: String | ISO8601 datetime (default: now)
Returned Params
  • total: Integer | total queries served in the window
  • series: Array<Object> | [{ name: String, data: [[unix_ms, count], ...] }]
  • date_from: String (ISO8601)
  • date_to: String (ISO8601)
Errors
  • 502 Bad Gateway | zone not yet provisioned, or upstream Bunny request failed

DNS Records

Available record types

The record_type field is an integer. The available types are:

Value Type
0 A (default)
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 (view-only; managed by automation)

List all records

Also returned when viewing a zone.

GET /api/dns_zones/:zone_id/records

Returned Params
  • dns_records: Array
    • id: String
    • record_type: Integer
    • ttl: Integer
    • value: String
    • name: String
    • priority: Integer
    • weight: Integer
    • port: Integer
    • flags: String
    • record_tag: String
    • comment: String
    • site: Object | If a pull zone (record_type == 7)
      • id: String
      • name: String
      • created_at: DateTime
      • updated_at: DateTime
      • primary_domain: String
      • location: String
      • package: String
    • created_at: DateTime
    • updated_at: DateTime

View Record

GET /api/dns_zones/:zone_id/records/:id

Returns a single dns_record object with the same fields as a list entry.

Create Record

POST /api/dns_zones/:zone_id/records

Params
  • dns_record: Object
    • record_type: Integer (required)
    • ttl: Integer
    • value: String
    • name: String
    • priority: Integer
    • weight: Integer
    • port: Integer
    • flags: Integer
    • record_tag: String
    • comment: String

On success renders the created record (same shape as show) with HTTP 200 (not 201). Invalid record → 422 (see errors array).

Update Record

PATCH /api/dns_zones/:zone_id/records/:id

name and record_type cannot be changed. Returns 202.

Params
  • dns_record: Object
    • ttl: Integer
    • value: String
    • priority: Integer
    • weight: Integer
    • port: Integer
    • flags: Integer
    • record_tag: String
    • comment: String

Delete Record

DELETE /api/dns_zones/:zone_id/records/:id

Returns 202.