AddResolverRule

Updated at:

Creates a forwarding rule.

Operation description

Precautions

If the outbound VPC and the inbound VPC are the same VPC, the IP address of the external DNS system in the forwarding rule associated with the outbound endpoint cannot be the same as the IP address of the inbound endpoint service. Otherwise, a request loop occurs and causes resolution failures.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

pvtz:AddResolverRule

create

*Endpoint

acs:pvtz:*:{#accountId}:endpoint/{#EndpointId}

*Rule

acs:pvtz:*:{#accountId}:rule/*

None None

Request parameters

Parameter

Type

Required

Description

Example

Name

string

No

The name of the forwarding rule. Specify a name based on your business requirements and the business meaning.

test

Type

string

No

The type of the forwarding rule. Valid values:

  • OUTBOUND: Forwards DNS queries to external IP addresses. Currently, this is the only supported value.

Note

You cannot change this value after the forwarding rule is created.

OUTBOUND

ZoneName

string

Yes

The domain name (zone) for which DNS resolution requests need to be forwarded.

Note

You cannot change this value after the forwarding rule is created.

example.com

EndpointId

string

No

The ID of the outbound endpoint. The outbound endpoint is used to forward DNS query traffic to the IP addresses specified in the destination IP address list.

hr****

ForwardIp

array<object>

Yes

The IP addresses and ports of the external DNS system. The IP addresses and ports of the destination servers to which DNS query traffic is forwarded. You can specify up to 6 IP addresses and ports. Both private and private IP addresses are supported.

Note

If the external DNS server you specify uses a private IP address and the ECS instances in the VPC of the outbound endpoint do not have private IP addresses, activate a NAT gateway and configure SNAT entries for the VPC NAT gateway.

object

No

The information about the forwarding destination.

Ip

string

Yes

The IP address of the forwarding destination.

Note

IP addresses in the following CIDR blocks are reserved for the system and cannot be configured as IP addresses of the external DNS system: 100.100.2.136 to 100.100.2.138, and 100.100.2.116 to 100.100.2.118.

172.16.XX.XX

Port

integer

Yes

The port number of the forwarding destination.

8080

Lang

string

No

The language of the response. Valid values:

  • zh: Chinese.

  • en: English.

Default value: en.

en

Vpcs

array<object>

No

The list of VPCs associated with the forwarding rule.

object

No

VpcUserId

integer

No

The ID of the user to which the VPC belongs.

1344387

VpcType

string

No

The type of the VPC.

STANDARD

RegionId

string

No

The ID of the region where the VPC resides.

cn-shenzhen

VpcId

string

No

The ID of the VPC.

vpc-bp1abcdefghijklmno

EdgeDnsClusters

array<object>

No

The list of self-managed DNS clusters associated with the forwarding rule.

object

No

ClusterId

string

No

The ID of the self-managed DNS cluster.

ec-1234567890123456789

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

725B8BED-901F-480C-BBAC-FA59A18580C1

RuleId

string

The ID of the forwarding rule.

hr****

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.