Deleting DNS Records
Both zone template records and site or site alias zone records can be deleted using the del_rec operation. You can retrieve multiple records in a single del_rec operation using filtering rules. For more information about filters, refer to the Available Filters section.
Request Packet Structure
A request XML packet deleting a DNS record from Plesk database includes the get_rec operation node:
The graphical representation of the del_rec node is as follows:
- The filter node is required. It specifies the filtering rule. For more information, refer to the Available Filters section. Data type: dnsSelectionFilterType(
- The template node is optional. If present, only DNS zone template records are available for deleting. In this case filter children cannot be specified as a filtering rule. Data type: none.
Note: If you leave the filter node blank (
<filter/>) all records (zone template records or zone records, depending on presence of the template node in the request packet) will be removed.
You can delete multiple DNS records in a single packet. Add as many del_rec operations as the number of different filtering rules.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The del_rec node of the output XML packet is structured as follows:
- The result node is optional. It is required if the operation del_rec succeeds and the data set retrieved from the server is not empty. If the id was set as a filtering rule in the request packet, the result node is also required. Data type: resultType (
- The status node is required. It specifies the execution status of the del_rec operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. It is used to return the error code when the del_rec operation fails. Data type: unsignedInt.
- The errtext node is optional. It is used to return the error message if the del_rec operation fails. Data type: string.
- The id node is required if the del_rec operation has succeeded. If the id was set as a filtering rule in the request packet, the id node is also required. Returns the unique identifier of the DNS record. Data type: integer.
Deleting a single DNS record
This request packet deletes DNS record with ID 75.
If the DNS record with ID 75 was not found on the server, the response from the server looks as follows:
Deleting multiple DNS records
This request packet deletes DNS records for the site ID 7 and the record with ID 5.
Response (when three DNS records for the site alias were deleted, and the record with ID 5 was not found on the server):