Description
Create DNS Record
Query
dns/create
List Variable
Name | Data Type | Required/Optional | Description |
---|---|---|---|
domain | Varchar(255) | Required | Naked Domain Name |
type | enum(A AAAA CNAME MX NS SRV TXT) | Required | Record type |
record | varchar | Required | DNS record (leave empty if same as naked domain name) |
Additional Parameter (regarding to DNS type)
Type | Name | Data Type | Required/Optional | Description |
---|---|---|---|---|
A | destination | IPv4 | Required on Type A | example: 34.54.45.23 |
A | class | IN | Required on Type A | default IN |
A | ttl | Integer | Required on Type A | contoh : 86400 |
AAAA | destination | IPv6 | Required on Type AAAA | example: fe80::76e5:43ff:fe12:26df |
AAAA | class | IN | Required on Type AAAA | default IN |
AAAA | ttl | Integer | Required on Type AAAA | example: 86400 |
CNAME | destination | varchar | Required on Type CNAME | domain destination |
CNAME | class | IN | Required on Type CNAME | default IN |
CNAME | ttl | Integer | Required on Type CNAME | example: 86400 |
MX | destination | Varchar | Required on Type MX | domain destination |
MX | preference | Integer | Required on Type MX | preference based on mail server |
MX | class | IN | Required on Type MX | default IN |
MX | ttl | Integer | Required on Type MX | example: 86400 |
NS | destination | varchar | Required on Type NS | nameserver |
NS | class | IN | Required on Type NS | default IN |
NS | ttl | Integer | Required on Type NS | example: 86400 |
SRV | destination | varchar | Required on Type SRV | |
SRV | priority | varchar | Required on Type SRV | |
SRV | weight | Integer | Required on Type SRV | |
SRV | port | Integer | Required on Type SRV | |
SRV | class | Integer | Required on Type SRV | default IN |
SRV | ttl | Integer | Required on Type SRV | example: 86400 |
TXT | destination | text | Required on Type TXT | text record |
TXT | class | IN | Required on Type TXT | default IN |
TXT | ttl | Integer | Required on Type TXT | example: 86400 |
Type
Example
$post["username"] = 'apiusername'; $post["password"] = hash('sha256','apipassword'); $post["domain"] = 'domain.co.id' $post["type"] = 'A' $post["destination"] = '34.54.65.65' $post["class"] = 'IN' $post["ttl"] = '86400' $url = 'http://[reseller url]/api/dns/create'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $apiurl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); $response = curl_exec($ch); curl_close($ch);
Example Response
Succeed:
<?xml version="1.0" encoding="UTF-8"?> <epp> <result> <resultCode>1000</resultCode> <resultMsg>Command Complete Succesfully</resultMsg> </result> <resultData/> </epp>
Failed:
<?xml version="1.0" encoding="UTF-8"?> <epp> <result> <resultCode>1001</resultCode> <resultMsg>Command Failed</resultMsg> </result> </epp>