Loading...

Knowledge Base

Add an SRV Record Using the API

When you want to add a Service (SRV) record using the API. This article explains the required parameters, service host format, priority, port, weight, TTL options, and API request details for SRV record creation.

Adding SRV Record

Description

Adds a Service (SRV) record.

Parameters

NameData TypeRequired / OptionalDescription
auth-useridIntegerRequiredAuthentication Parameter
api-keyStringRequiredAuthentication Parameter
domain-nameStringRequiredDomain name for which you want to add the SRV record
valueStringRequiredThe hostname of the machine providing the service
hostStringRequired

A fully qualified Service name consisting of:

  • Service Record

  • Protocol

  • Domain Name

This is mentioned as _< service-name >._< protocol >.domain-name.com

Example:

_chat._tcp.domain-name.com.

ttlIntegerOptionalNumber of seconds the record needs to be cached by the DNS Resolvers. Default value is 14400.
priorityIntegerOptionalThe Priority of the host. Value ranges from 0 to 65535.
portIntegerOptionalThe port number of the service
weightIntegerOptionalA relative weight for records with the same priority

HTTP Method

POST

Example Test URL Request

https://test.httpapi.com/api/dns/manage/add-srv-record.json?auth-userid=0&api-key=key&domain-name=domain.asia&host=_chat._tcp.domain-name.com&value=chat.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 error description (as value) will be returned.