Loading...

Knowledge Base

How to Add a CNAME Record Using the API

When you need to create a CNAME record using the API. This article explains required parameters, request format, and API response behavior for CNAME record creation.

 

  • Description
  • Parameters
  • HTTP Method
  • Example Test URL Request
  • Response
 
Description
 
Adds a Canonical (CNAME) record.
 
Parameters
Name
Data Type
Required / Optional
Description
auth-userid
Integer
Required
Authentication Parameter
api-key
String
Required
Authentication Parameter
domain-name
String
Required
Domain name for which you want to add the CNAME record
value
String
Required
A Fully Qualified Domain Name (FQDN) as the destination
host
String
Optional
The host part of the domain name for which you need to add a CNAME
Example:
You may send this as "www", if u wish to add the CNAME record as www.domainname.com.
ttl
Integer
Optional
The number of seconds the record needs to be cached by the DNS Resolvers. The default value is 14400.
 
HTTP Method
 
POST
 
Example Test URL Request

https://test.httpapi.com/api/dns/manage/add-cname-record.json?auth-userid=0&api-key=key&domain-name=domain.asia&value=www.domain.com

 
Response
Returns "Success" as the status of the response if the record is added successfully.
In case of any error, an "error" key with an error description (as value) will be returned.