Creates a forwarding rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AddResolverRule

The operation that you want to perform. Set the value to AddResolverRule.

Lang String Yes en

The language.

Name String Yes Test

The name of the forwarding rule.

Type String Yes OUTBOUND

The type of the forwarding rule. Valid value:

  • OUTBOUND: forwards Domain Name System (DNS) traffic to one or more external IP addresses.
ZoneName String Yes example.com

The domain name that requires DNS traffic forwarding.

EndpointId String Yes hra0**

The ID of the endpoint.

ForwardIp.N.Ip String Yes 172.16.xx.xx

The IP address of the destination external server.

ForwardIp.N.Port Integer Yes 8080

The port number of the destination external server.

Response parameters

Parameter Type Example Description
RequestId String 725B8BED-901F-480C-BBAC-FA59A18580C1

The ID of the request.

RuleId String hra0**

The ID of the forwarding rule.

Examples

Sample request

http(s)://pvtz.aliyuncs.com/?Action=AddResolverRule
&Lang=en
&Name=Test
&Type=OUTBOUND
&ZoneName=example.com
&EndpointId=hra0**
&ForwardIp=[{"Ip":"172.16.xx.xx","Port":8080}]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<AddResolverRuleResponse>
    <RequestId>725B8BED-901F-480C-BBAC-FA59A18580C1</RequestId>
    <RuleId>hra0**</RuleId>
</AddResolverRuleResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "725B8BED-901F-480C-BBAC-FA59A18580C1",
  "RuleId" : "hra0**"
}

Error codes

For a list of error codes, visit the API Error Center.