Adding Primary Name Server
Use the add_master_server operation to add a primary name server. This server will be primary for the zone specified by the site ID or site alias ID. You can add multiple primary servers in a single packet.
Request Packet Structure
A request XML packet adding a primary name server includes the add_master_server operation node:
The graphical representation of the add_master_server node is as follows:
- The site-id node is required. Specifies the ID of the site, which zone will be served by the primary name server. Data type: integer.
- The site-alias-id node is required. Specifies the ID of the site alias, which zone will be served by the primary name server. Data type: integer.
- The ip_address node is required. Specifies the IP address of a primary name server. Data type: integer.
You can add multiple primary name servers in a single packet. Add as many add_master_server operations as the number of different servers you want to add.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The add_master_server node of the output XML packet is structured as follows:
- 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 add_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 add_master_server operation fails. Data type: unsignedInt.
- The errtext node is optional. It is used to return the error message if the add_master_server operation fails. Data type: string.
- The id node is optional. It is required if the operation add_master_server has succeeded. Returns the ID of the primary name server in Plesk database. Data type: integer.
Samples
Adding a single primary name server
This request packet adds a primary name server to the zone of the site with ID 5.
Response:
If the IP address parameter has invalid format, the response looks as follows:
If the site specified by the ID was not found on the server, the response looks as follows:
Adding multiple primary name servers
This request packet adds a primary name server to the zone of the site with ID 5 and ID 7.
Response: