The type of recursion can be changed by the set-recursion operation. Before setting the recursion type, make sure it is supported by the server.

Request Packet Structure

A request XML packet changing the recursion type includes the set-recursion operation node:

<packet version="1.6.7.0">
<dns>
   <set-recursion>
   ...
   </set-recursion>
</dns>
</packet>

The set-recursion node is presented by type DNSSetRecursionInputType (dns_input.xsd) and structured as follows:

image0

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.
  • The value node is required. Specifies the type of recursion. Data type: DNSRecursionValueType (plesk_dns.xsd) . Allowed values: on | off | local | localnets.

Response Packet Structure

The set-recursion node is presented by type DNSSetRecursionOutputType (dns_output.xsd) and is structured as follows:

image1

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.
  • The result node is required. It wraps the information got from the server. Data type: resultType (common.xsd).
  • The status node is required. It specifies the execution status of the set-recursion operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. It is used to return the error code when the set-recursion operation fails. Data type: unsignedInt.
  • The errtext node is optional. It is used to return the error message if the set-recursion operation fails. Data type: string.

Samples

Allowing all recursive requests to the local DNS server

This packet allows all recursive requests to the local DNS server.

<packet version="1.6.7.0">
<dns>
 <set-recursion>
  <value>on</value>
 </set-recursion>
</dns>
</packet>

Response:

<code><packet version="1.6.7.0"></code>
<dns></code>
 <set-recursion></code>
  <result></code>
   <status>ok</status></code>
  </result></code>
 </set-recursion></code>
</dns></code>
</packet></code>

Allowing recursive requests from the local net to the local DNS server

This packet allows recursive requests coming from the local net to the local DNS server.

<packet version="1.6.7.0">
<dns>
 <set-recursion>
  <value>localnets</value>
 </set-recursion>
</dns>
</packet>