This article provides a guide for a VPS User to delete DNS record using the VPS User API.
Use Delete DNS Record API to delete DNS record on VPS of your server.
HTTP Request
https://vm1.apivps.com:4083/index.php?act=managezone&domainid=DID&delete=RID
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | managezone | The action which will return data belonging to a particular page | Yes |
domainid | POST | int | Provide domain ID of which you want to delete the record. | Yes |
delete | POST | int | Provide record ID to be deleted. |
Sample Code
PHP
<?php
require_once('/usr/local/virtualizor/sdk/enduser.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'host_ip';
$v = new Virtualizor_Enduser_API($ip, $key, $pass);
$did = 4; //domain id
$post['delete'] = 19; //record id
$vps = $v->managezone($did,$post);
print_r(json_encode($vps));
?>
Curl
curl -k -X POST -d "delete=19" -L "https://vm1.apivps.com:4083/index.php?act=managezone&domainid=DID&api=json&apikey=your_api_key&apipass=your_api_pass"
Output
{
"uid":"1",
"act":"managezone",
"timezone":0,
"timenow":"July 27, 2023, 4:28 am",
"vpsid":"7",
"username":"abc@abc.com",
"user_type":"2",
"preferences":{
"fname":"joe",
"lname":"doe",
"theme":"default",
"language":"english",
"timezone":0
},
"url":"index.php?",
"rdns":{
"pdnsid":"1"
},
"pdns":{
"pdnsid":"1"
},
"title":"APIVPS",
"del_done":true,
"domain":null,
"domains":{
"3":{
"id":"3",
"name":"testzone",
"master":null,
"last_check":null,
"type":"MASTER",
"notified_serial":null,
"account":null,
"virtualizor_uid":"1"
},
"4":{
"id":"4",
"name":"myzone",
"master":null,
"last_check":null,
"type":"MASTER",
"notified_serial":null,
"account":null,
"virtualizor_uid":"1"
}
},
"records":null,
"manage_type":[
"A",
"CNAME",
"MX",
"NS",
"AAAA",
"TXT"
],
"domainid":4,
"done":{
"msg":"The record has been deleted successfully",
"goto":"act=managezone&domainid=4"
},
"time_taken":"0.112"
}