POST - Create an SRV record in a Zone

Purpose

This API adds a Service (SRV) record to a specified DNS zone. SRV records are used to define the location (hostname and port) of servers for specific services, such as SIP, XMPP, LDAP, and email protocols. It helps direct traffic to the appropriate service endpoints, distributes requests efficiently across multiple servers and simplifies the process of managing service records in a massive scale. This API enhances network efficiency and reliability by ensuring proper service routing and failover handling.

Request URL

Method: POST

https://{appconsole_IP}:{9443}/api/dns/zone/{zone_pk}/SRV/

Request Headers

The following headers must be included in the API request for successful authentication and data submission:

Authorization: DDI Central's OAuth implementation uses the Bearer authentication scheme. Hence, while making API calls, access_token obtained via the OAuth 2.0 Client Credentials Grant must be included in the Authorization header of API requests. This token verifies the client’s identity and ensures appropriate permissions for accessing resources.

The Authorization Header follows the format below:

headers = { "Authorization": "Bearer {bearer_tk}" }


Content-Type: Required in the header to indicate the media type of the resource being sent. It helps the server at the receiving end understand how to process the transmitted request body.

The Content-Type Header follows the format below:

headers ={ "Content-Type": "application/json" }

Path Parameters

  • zone_pk* long
    • Specifies the unique identifier of the DNS zone where the SRV record will be added.
    • Example: 5867.

Request Body

  • domain_name* string
    • The domain or subdomain for which the SRV record is being created.
    • Example: "srv7.hellotest109.com.".
  • domain_ttl* integer
    • Time-to-live (TTL) value in seconds, determining how long the record is cached.
    • Example: 86400 (1 day).
  • zone_name* string
    • The DNS zone where the SRV record will be added.
    • Example: "hellotest109.com.".
  • cluster_name* string
    • Name of the cluster managing this DNS zone.
    • Example: "wincluster-zoho".
  • records* an array of string
    • Defines one or more SRV records for the domain.
    • Each object contains:
      • port: The port number on which the service is running (Example: 587 for SMTP).
      • srv_weight: A weight value that helps in load balancing (Example: 10).
      • priority: The priority of the target host (lower values are given higher priority, Example: 4).
      • target: The hostname of the service provider (Example: "srv.the.fgsgs.").
    • Example:
      • [{"port":"587","srv_weight":"10","priority":"4","target":"srv.the.fgsgs."}, {"port":"456","srv_weight":"10","priority":"2","target":"xmtp.sd.ds.fg."}]

 

- Mandatory parameter.

 

Sample Request

Copied
{
   "domain_name":"srv7.hellotest109.com.",
   "domain_ttl":86400,
   "zone_name":"hellotest109.com.",
   "cluster_name":"wincluster-zoho",
   "records":[
      {
         "port":587,
         "srv_weight":10,
         "priority":4,
         "target":"srv.the.fgsgs."
      },
      {
         "port":456,
         "srv_weight":10,
         "priority":2,
         "target":"xmtp.sd.ds.fg."
      }
   ]
}
                                  

Sample Response

Copied
{
   "srv_domain_id":177,
   "zone_id":5867,
   "domain_name":"srv7.hellotest109.com.",
   "domain_ttl":86400,
   "records":[
      {
         "port":587,
         "srv_weight":10,
         "priority":4,
         "target":"srv.the.fgsgs."
      },
      {
         "port":456,
         "srv_weight":10,
         "priority":2,
         "target":"xmtp.sd.ds.fg."
      }
   ]
}