DNS - Delete DNS Server


This article provides a guide for a VPS User to delete DNS server using the VPS User API.

Use Delete DNS API to delete existing DNS server from your server.

HTTP Request

https://vm1.apivps.com: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://vm1.apivps.com: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, 2023, 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:\/\/apivps.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"
}
  • vps api, dns server, vps guide
  • 0 Uživatelům pomohlo
Byla tato odpověď nápomocná?

Related Articles

DNS - List DNS Server

This article provides a guide for a VPS User to list DNS server info using the VPS User API. Use...

DNS Record - Zone Info

This article provides a guide for a VPS User to get DNS record zone info using the VPS User API....

DNS - Add DNS Server

This article provides a guide for a VPS User to add DNS server using the VPS User API. Use Add...

DNS Record - Add DNS Record

This article provides a guide for a VPS User to add DNS record using the VPS User API. Use Add...

DNS Record - Edit DNS Record

This article provides a guide for a VPS User to edit DNS record using the VPS User API. Use Edit...