Switching Name Server Mode

To switch a name server between master and slave mode, use the switch operation. You can switch multiple name servers in a single packet. To retrieve the zone type, refer to the Retrieving Parameters of SOA Record and Zone section.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 
Request Packet Structure

A request XML packet changing name server mode includes the switch operation node:

<packet>
<dns>
   <switch>
   ...
   </switch>
</dns>
</packet>

 

The graphical representation of the switch node is as follows:

You can change mode of multiple name servers in a single packet. Add as many switch operations as the number of different filtering rules, you use to change the mode of name servers you need.

<dns>
   <switch>
   ...
   </switch>
...
   <switch>
   ...
   </switch>
</dns>

Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.

 
Response Packet Structure

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

 

 
Samples
Changing status of a single name server

This request packet makes the DNS server act as a secondary for the zone specified by site ID 1.

<packet>
<dns>
 <switch>
  <filter>
   <site-id>1</site-id>
  </filter>
  <zone_type>slave</zone_type>
 </switch>
</dns>
</packet>

Response:

<packet>
<dns>
 <switch>
  <result>
   <status>ok</status>
   <site-id>1</site-id>
  </result>
 </switch>
</dns>
</packet>

Changing status of multiple name servers

This packet makes the DNS server act as a secondary for the zones specified by sites ID 1 and ID 2.

<packet>
<dns>
 <switch>
  <filter>
   <site-id>1</site-id>
   <site-id>2</site-id>
  </filter>
  <zone_type>slave</zone_type>
 </switch>
</dns>
</packet>

Response (when the site with ID 2 was not found):

<packet>
<dns>
 <switch>
  <result>
   <status>ok</status>
   <site-id>1</site-id>
  </result>
  <result>
   <status>error</status>
   <errcode>1015</errcode>
   <errtext>site does not exist</errtext>
   <site-id>2</site-id>
  </result>
 </switch>
</dns>
</packet>