Use Delete DNS API to delete existing DNS server from your server.
HTTP Request
https://hostname:4083/index.php?act=pdns
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | pdns | The action will delete the dns entries and return the result | Yes |
id | POST | Int | The entry that needs to be deleted. | Yes |
Sample Code
PHP
<?php
require_once('/usr/local/virtualizor/sdk/enduser.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Enduser_API($ip, $key, $pass);
$id = 11;
$post = array(); //keep this empty if you want to delete a zone.
$output = $admin->pdns($post, $id);
print_r(json_encode($output));
?>
Curl
curl -k -X POST -d "del=11" -L
"https:/hostname:4083/index.php?act=pdns&
api=json&apikey=your_api_key&apipass=your_api_pass"
Output
{
"uid": "5",
"act": "pdns",
"timezone": 1,
"timenow": "October 14, 2016, 12:44 pm",
"vpsid": "3587",
"username": "test@test.com",
"user_type": "2",
"preferences": {
"fname": "",
"lname": "",
"theme": "default",
"language": "english",
"timezone": 1
},
"url": "index.php?",
"rdns": {
"pdnsid": "1"
},
"pdns": {
"pdnsid": "1"
},
"support_link": "http:\/\/softaculous.com",
"disable_login_logo": 1,
"title": "DNS Management",
"delete_done": true,
"done": {
"msg": "The Zone has been deleted successfully",
"goto": "act=pdns"
},
"domains": {
"2": {
"id": "2",
"name": "test123.com",
"master": null,
"last_check": null,
"type": "MASTER",
"notified_serial": null,
"account": null,
"solusvm_cid": "5"
}
},
"time_taken": "0.089"
}