You can export, modify, or import multiple website configurations at a time by using an XML file. This topic describes how to configure a website in an XML file.

Parameters

The website configurations in an XML file start with the <DomainList> tag, end with the </DomainList> tag, and include the parameters for multiple websites between the <DomainList> tag pair. The configurations for each website start with the <DomainConfig> tag, ends with the </DomainConfig> tag, and include parameters for each website between the <DomainConfig> tag pair.

Note An extra tag pair <DomainConfig>...... </DomainConfig> is required for each additional website configuration.
Parameter Description
<Domain>a.com</Domain> The domain name that you want to associate with an Anti-DDoS Pro or Anti-DDoS Premium instance. You can enter only one domain name in a tag pair.
<ProtocolConfig><ProtocolList>http,https</ProtocolList></ProtocolConfig> The protocol type of the domain name. You can separate multiple protocol types with commas (,). In this example, the protocol types of the domain name are HTTP and HTTPS.
<InstanceConfig><InstanceList>ddoscoo-cn-xxxxxxxxx001</InstanceList></InstanceConfig> The instances that you want to associate with the domain name.
Note Each instance has a unique ID. Enter the instance IDs between the <InstanceList> tag pair. Separate multiple instance IDs with commas (,).
<RealServerConfig><ServerType>0</ServerType><ServerList>1.x.x.4</ServerList></RealServerConfig> The information of the origin server. The configurations include the following parameters:
  • <ServerType>0</ServerType>: identifies origin servers by using IP addresses.
  • <ServerType>1</ServerType>: identifies origin servers by using domain names.

<ServerList>1.x.x.4</ServerList>: the addresses of the origin server. Separate multiple addresses with commas (,)

Note To associate the domain name of an origin server with an instance, you can use either the IP address or the domain name of an origin server.

Example

<DomainList>
 <DomainConfig>
 <Domain>a.com</Domain>
 <ProtocolConfig>
 <ProtocolList>http,https</ProtocolList>
 </ProtocolConfig>
 <InstanceConfig>
 <InstanceList>ddoscoo-cn-xxxxxxxxx001</InstanceList>
 </InstanceConfig>
 <RealServerConfig>
 <ServerType>0</ServerType>
 <ServerList>1.x.x.4</ServerList>
 </RealServerConfig>
 </DomainConfig>
 <DomainConfig>
 <Domain>b.com</Domain>
 <ProtocolConfig>
 <ProtocolList>http,websocket,websockets</ProtocolList>
 </ProtocolConfig>
 <InstanceConfig>
 <InstanceList>ddoscoo-cn-xxxxxxxxx002,ddoscoo-cn-xxxxxxxxx00d</InstanceList>
 </InstanceConfig>
 <RealServerConfig>
 <ServerType>1</ServerType>
 <ServerList>q840a82zf2j23afs.xxxxxxxxx.com</ServerList>
 </RealServerConfig>
 </DomainConfig>
 </DomainList>
In this example, the following website configurations are added:
  • The domain name is a.com. The protocols are HTTP and HTTPS. The associated instance is ddoscoo-cn-xxxxxxxxx001. The IP address of the origin server is 1.x.x.4.
  • The domain name is b.com. The protocols are HTTP, WebSocket, and WebSockets. The associated instances are ddoscoo-cn-xxxxxxxxx002 and ddoscoo-cn-xxxxxxxxx00dddoscoo-cn-xxxxxxxxx001. The domain name of the origin server is q840a82zf2j23afs.xxxxxxxxx.com.