The enable operation is used to enable local DNS support for the current zone. With the operation, you can also enable or disable the local DNS support for the DNS zone template. All the sites or site alias zones, which were added according to the template with the enabled status, will be supported by local DNS. You can enable the local DNS support for multiple zones in a single packet.

To learn how to retrieve the status information for the local DNS server, refer to the Managing SOA Records and Zone Parameters section.

Request Packet Structure

A request XML packet switching on the local DNS support includes the enable operation node:

<packet version="1.6.7.0">
<dns>
   <enable>
   ...
   </enable>
</dns>
</packet>

The graphical representation of the enable node is as follows:

image 35045

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 filter node is optional. It specifies the filtering rule. If the filter node is omitted, the DNS zone template will change status to “enable”. For more information, refer to the Available Filters section. Data type: dnsSelectionFilterType (dns_input.xsd) .

You can enable the local DNS support for multiple zones. Add as many enable operations as the number of different filtering rules.

<dns>
   <enable>
   ...
   </enable>
...
   <enable>
   ...
   </enable>
</dns>

Response Packet Structure

The enable node of the output XML packet is structured as follows:

image 35055

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 response from the server. Data type: resultOpType (dns_output.xsd).
  • The status node is required. It specifies the execution status of the enable operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. It is used to return the error code when the enable operation fails. Data type: unsignedInt.
  • The errtext node is optional. It is used to return the error message if the enable operation fails. Data type: string.
  • The site-id node is optional. It is required if the site ID was set as a filtering rule in the response packet . Specifies the ID of the site, which zone will use local DNS. Data type: integer.
  • The site-alias-id node is optional. It is required if the site ID was set as a filtering rule in the response packet . Specifies the ID of the site alias, which zone will use local DNS. Data type: integer.

Samples

Enabling the local DNS for two zones

This request packet enables the local DNS for the zones specified by site ID 8 and ID 9.

<packet version="1.6.3.0">
<dns>
 <enable>
 <filter>
   <site-id>8</site-id>
   <site-id>9</site-id>
 </filter>
 </enable>
</dns>
</packet>

Response:

<packet version="1.6.3.0">
<dns>
 <enable>
 <result>
   <status>ok</status>
   <site-id>8</site-id>
 </result>
 <result>
   <status>ok</status>
   <site-id>9</site-id>
 </result>
 </enable>
</dns>
</packet>

Enabling the local DNS for the DNS zone template

This packet enables the local DNS for the DNS zone template .

<packet version="1.6.7.0">
<dns>
<enable/>
</dns>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <dns>
    <enable>
      <result>
        <status>ok</status>
      </result>
    </enable>
  </dns>
</packet>