POST - Create an NS record in a Zone

Purpose

This API adds a Name Server (NS) record to a specified DNS zone. NS records define the authoritative DNS servers for a domain, ensuring proper domain resolution and delegation. This API call supports scalability by assigning multiple name servers for redundancy and load balancing and ensures queries are routed to the correct DNS servers. This API enhances DNS infrastructure reliability by ensuring domains have properly assigned authoritative name servers.

Request URL

Method: POST

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

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 NS record will be added.
    • Example: 5867.

Request Body

  • domain_name* string
    • The subdomain or hostname for which the NS record is being created.
    • Example: "ns2.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 NS record will be added.
    • Example: "hellotest109.com.".
  • cluster_name* string
    • Name of the cluster managing this DNS zone.
    • Example: "wincluster-zoho".
  • records* array of strings
    • List of authoritative name servers for the domain.
    • Each entry should be a Fully Qualified Domain Name (FQDN) of a name server.
    • Example:
      • ["c1.host3.com","c2.host4.com"]

 

- Mandatory parameter.

 

Sample Request

Copied
{
   "domain_name":"ns2.hellotest109.com.",
   "domain_ttl":86400,
   "zone_name":"hellotest109.com.",
   "cluster_name":"wincluster-zoho",
   "records":[
      "c1.host3.com",
      "c2.host4.com"
   ]
}
                                  

Sample Response

Copied
{
   "ns_domain_id":6460,
   "zone_id":5867,
   "domain_name":"ns2.hellotest109.com.",
   "domain_ttl":86400,
   "records":[
      "c1.host3.com",
      "c2.host4.com"
   ]
}