> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-support-migration.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Add DNS Record



## OpenAPI

````yaml https://core-api-public-docs.b-cdn.net/docs/v3/public.json put /dnszone/{zoneId}/records
openapi: 3.0.0
info:
  title: bunny.net API
  description: >-
    <img src='https://bunny.net/v2/images/bunnynet-logo-dark.svg' style='width:
    200px;' alt='bunny.net Logo'>
                   Learn how to use the [bunny.net](https://bunny.net "bunny.net - The content delivery platform that truly hops.") API. Everything that can be done with the control panel can also be achieved with our API documented on this page. To learn how to use the storage API, have a look at our <a href='https://bunnycdnstorage.docs.apiary.io/#'>storage API documentation</a>
                   <h2>Third party API clients:</h2> 
                   <br/>
                   We currently do not maintain an official API library, but you can use one of the third party ones provided here:<br/><br/>
                   <a rel='nofollow' href='https://github.com/codewithmark/bunnycdn'>https://github.com/codewithmark/bunnycdn</a> (bunny.net PHP library, thanks to <a rel="nofollow" href='https://codewithmark.com'>Code With Mark</a>)
                   <br/><br/>
                   <i style='font-size: 11px;'><b>Note that third party clients are not maintained or developed by bunny.net so we unfortunately cannot offer support for them.</b></i>
  termsOfService: https://bunny.net/tos
  contact:
    name: bunny.net
    url: https://docs.bunny.net
    email: support@bunny.net
  version: 1.0.0
servers:
  - url: https://api.bunny.net
    description: bunny.net API Server
security:
  - AccessKey: []
tags:
  - name: Stream Video Library
  - name: User
  - name: AuditLog
  - name: Storage Zone
  - name: Statistics
  - name: Search
  - name: Pull Zone
  - name: DNS Zone
  - name: DNSSEC
  - name: Billing
  - name: API Keys
  - name: Affiliate
  - name: Countries
  - name: Purge
  - name: Region
paths:
  /dnszone/{zoneId}/records:
    put:
      tags:
        - DNS Zone
      summary: Add DNS Record
      operationId: DnsZonePublic_AddRecord
      parameters:
        - name: zoneId
          in: path
          required: true
          description: The DNS Zone ID to which the record will be added.
          schema:
            type: integer
            format: int64
          x-position: 1
      requestBody:
        x-name: recordModel
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddDnsRecordModel'
        required: true
        x-position: 2
      responses:
        '201':
          description: The DNS record was successfuly added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DnsRecordModel'
        '400':
          description: Failed adding the DNS record. Model validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorData'
        '401':
          description: The request authorization failed
        '404':
          description: The DNS Zone with the requested ID does not exist.
        '500':
          description: Internal Server Error
components:
  schemas:
    AddDnsRecordModel:
      type: object
      additionalProperties: false
      properties:
        Type:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/DnsRecordTypes'
        Ttl:
          type: integer
          format: int32
          nullable: true
        Value:
          type: string
          nullable: true
        Name:
          type: string
          nullable: true
        Weight:
          type: integer
          format: int32
          nullable: true
        Priority:
          type: integer
          format: int32
          nullable: true
        Flags:
          type: integer
          format: byte
          nullable: true
        Tag:
          type: string
          nullable: true
        Port:
          type: integer
          format: int32
          nullable: true
        PullZoneId:
          type: integer
          format: int64
          nullable: true
        ScriptId:
          type: integer
          format: int64
          nullable: true
        Accelerated:
          type: boolean
          nullable: true
        MonitorType:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/DnsMonitoringType'
        GeolocationLatitude:
          type: number
          format: double
          nullable: true
        GeolocationLongitude:
          type: number
          format: double
          nullable: true
        LatencyZone:
          type: string
          nullable: true
        SmartRoutingType:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/DnsSmartRoutingType'
        Disabled:
          type: boolean
          nullable: true
        EnviromentalVariables:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/DnsRecordEnviromentalVariableModel'
        Comment:
          type: string
          nullable: true
        AutoSslIssuance:
          type: boolean
          nullable: true
    DnsRecordModel:
      type: object
      additionalProperties: false
      properties:
        Id:
          type: integer
          format: int64
        Type:
          $ref: '#/components/schemas/DnsRecordTypes'
        Ttl:
          type: integer
          format: int32
        Value:
          type: string
          nullable: true
        Name:
          type: string
          nullable: true
        Weight:
          type: integer
          format: int32
        Priority:
          type: integer
          format: int32
        Port:
          type: integer
          format: int32
        Flags:
          type: integer
          format: byte
        Tag:
          type: string
          nullable: true
        Accelerated:
          type: boolean
        AcceleratedPullZoneId:
          type: integer
          format: int64
        LinkName:
          type: string
          nullable: true
        IPGeoLocationInfo:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/GeoDnsLocationModel'
        GeolocationInfo:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/DnsRecordGeoLocationInfo'
        MonitorStatus:
          $ref: '#/components/schemas/DnsMonitoringStatus'
        MonitorType:
          $ref: '#/components/schemas/DnsMonitoringType'
        GeolocationLatitude:
          type: number
          format: double
        GeolocationLongitude:
          type: number
          format: double
        EnviromentalVariables:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/DnsRecordEnviromentalVariableModel'
        LatencyZone:
          type: string
          nullable: true
        SmartRoutingType:
          $ref: '#/components/schemas/DnsSmartRoutingType'
        Disabled:
          type: boolean
        Comment:
          type: string
          nullable: true
        AutoSslIssuance:
          type: boolean
        AccelerationStatus:
          $ref: '#/components/schemas/AcceleratedStatus'
    ApiErrorData:
      type: object
      additionalProperties: false
      properties:
        ErrorKey:
          type: string
          nullable: true
        Field:
          type: string
          nullable: true
        Message:
          type: string
          nullable: true
    DnsRecordTypes:
      type: integer
      description: |-
        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
      x-enumNames:
        - A
        - AAAA
        - CNAME
        - TXT
        - MX
        - Redirect
        - Flatten
        - PullZone
        - SRV
        - CAA
        - PTR
        - Script
        - NS
        - SVCB
        - HTTPS
        - TLSA
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
    DnsMonitoringType:
      type: integer
      description: |-
        0 = None
        1 = Ping
        2 = Http
        3 = Monitor
      x-enumNames:
        - None
        - Ping
        - Http
        - Monitor
      enum:
        - 0
        - 1
        - 2
        - 3
    DnsSmartRoutingType:
      type: integer
      description: |-
        0 = None
        1 = Latency
        2 = Geolocation
      x-enumNames:
        - None
        - Latency
        - Geolocation
      enum:
        - 0
        - 1
        - 2
    DnsRecordEnviromentalVariableModel:
      type: object
      additionalProperties: false
      properties:
        Name:
          type: string
          nullable: true
        Value:
          type: string
          nullable: true
    GeoDnsLocationModel:
      type: object
      additionalProperties: false
      properties:
        CountryCode:
          type: string
          description: The ISO country code of the location
          nullable: true
        Country:
          type: string
          description: The name of the country of the location
          nullable: true
        ASN:
          type: integer
          description: The ASN of the IP organization
          format: int64
        OrganizationName:
          type: string
          description: The mame of the organization that owns the IP
          nullable: true
        City:
          type: string
          description: The name of the city of the location
          nullable: true
    DnsRecordGeoLocationInfo:
      type: object
      additionalProperties: false
      properties:
        Country:
          type: string
          nullable: true
        City:
          type: string
          nullable: true
        Latitude:
          type: number
          format: double
        Longitude:
          type: number
          format: double
    DnsMonitoringStatus:
      type: integer
      description: |-
        0 = Unknown
        1 = Online
        2 = Offline
      x-enumNames:
        - Unknown
        - Online
        - Offline
      enum:
        - 0
        - 1
        - 2
    AcceleratedStatus:
      type: integer
      description: |-
        0 = None
        1 = Pending
        2 = Processing
        3 = Completed
        4 = Failed
      x-enumNames:
        - None
        - Pending
        - Processing
        - Completed
        - Failed
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
  securitySchemes:
    AccessKey:
      type: apiKey
      description: API Access Key authorization header
      name: AccessKey
      in: header

````