Deleting Primary Name Servers
Use the del_master_server operation to delete primary name servers from the specified zone. You can delete multiple primary servers in a single packet.
Request Packet Structure
A request XML packet deleting a primary name server includes the del_master_server operation node:
<packet>
<dns>
<del_master_server>
...
</del_master_server>
</dns>
</packet>
The graphical representation of the del_master_server node is as follows:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.9.1/agent_input.svg.
- The filter node is required. It specifies the filtering rule.
For more information, refer to the Available Filters
section. Data type: dnsSelectionFilterType (
dns_input.xsd
) .
Note: If the filter node is left blank (<filter/>
), the operation
removes all primary name servers available for a packet sender on the
server.
You can delete multiple primary name servers in a single packet. Add as many del_master_server operations as the number of different filtering rules you use.
<dns>
<del_master_server>
...
</del_master_server>
...
<del_master_server>
...
</del_master_server>
</dns>
Response Packet Structure
The get_master_server node of the output XML packet is structured as follows:
Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.9.1/agent_output.svg.
- The result node is required. It wraps the response from the
server. Data type: resultType (
common.xsd
). - The status node is required. It specifies the execution status of the del_master_server operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. It is used to return the error code when the del_master_server operation fails. Data type: unsignedInt
- The errtext node is optional. It is used to return the error message if the del_master_server operation fails. Data type: string.
- The id node is optional. It is required if the operation del_master_server has succeeded. Returns the ID of the primary name server in Plesk database. Data type: integer.
Samples
Removing a single name server
This packet removes the primary name server specified by ID 5.
<packet>
<dns>
<del_master_server>
<filter>
<id>5</id>
</filter>
</del_master_server>
</dns>
</packet>
Response:
<packet>
<dns>
<del_master_server>
<result>
<status>ok</status>
<id>5</id>
</result>
</del_master_server>
</dns>
</packet>
If the name server specified by the ID was not found, the response can look as follows:
<packet>
<dns>
<del_master_server>
<result>
<status>error</status>
<errcode>1013</errcode>
<errtext>Master server is not found. ID : 5</errtext>
</result>
</del_master_server>
</dns>
</packet>
If the site specified by the ID was not found, the response can look as follows:
<packet>
<dns>
<del_master_server>
<result>
<status>error</status>
<errcode>1015</errcode>
<errtext>site does not exist.</errtext>
</result>
</del_master_server>
</dns>
</packet>
Removing multiple name servers
This packet deletes primary name servers for the zones specified by site ID 5 and ID 6, and primary server with ID 25.
<packet>
<dns>
<del_master_server>
<filter>
<site-id>5</site-id>
<site-id>6</site-id>
</filter>
</del_master_server>
<del_master_server>
<filter>
<id>25</id>
</filter>
</del_master_server>
</dns>
</packet>
Response (when three primary servers on the sites with ID 5 and ID 6 were removed, and the primary server with ID 25 was not found on the server):
<packet>
<dns>
<del_master_server>
<result>
<status>ok</status>
<id>15</id>
</result>
<result>
<status>ok</status>
<id>16</id>
</result>
<result>
<status>ok</status>
<id>28</id>
</result>
</del_master_server>
<del_master_server>
<result>
<status>error</status>
<errcode>1015</errcode>
<errtext>Master server is not found. ID : 25</errtext>
</result>
</del_master_server>
</dns>
</packet>