All Products
Search
Document Center

Smart Access Gateway:AddSmartAccessGatewayDnsForward

Last Updated:Oct 26, 2026

Adds DNS forwarding for Smart Access Gateway instances whose device type is SCG5000 or SCG5000-5G and whose device version is 3.4.2 or later.

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

smartag:AddSmartAccessGatewayDnsForward

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

SagInsId

string

Yes

The ID of the gateway instance.

sag-v9un1ccz22owd76lf8

SagSn

string

Yes

The SN of the device.

sagf4dkqh78

Domain

string

Yes

The domain name.

Note
  • Wildcard domain names and full match are supported. You can enter an asterisk (*) to match all domain names. For example: *.baidu.com. The allowed input format is baidu.com.

www.aliyun.com

MasterIp

string

Yes

The primary DNS server.

114.114.114.114

SlaveIp

string

No

The secondary DNS server.

172.16.0.14

Mode

string

No

The forwarding mode.

Note
  • This field is invalid and can be ignored.

first

OutboundPortType

string

No

The outbound port type.

Note
  • A value of Tunnel indicates a tunnel port, and a value of PhysicalPort indicates a physical port.

Valid values:

  • Tunnel :

    Tunnel

  • PhysicalPort :

    PhysicalPort

  • None :

    None

Tunnel

OutboundPortIndex

string

No

The outbound port index.

Note
  • This parameter is optional when OutboundPortType is set to PhysicalPort, and is not required when OutboundPortType is set to Tunnel.

  • OutboundPortIndex and OutboundPortName have a one-to-one mapping: 0 maps to eth0, and 2 maps to lte.

Valid values:

  • 0 :

    0

  • 2 :

    2

0

OutboundPortName

string

No

The outbound port.

Note
  • This parameter is optional when OutboundPortType is set to PhysicalPort, and is not required when OutboundPortType is set to Tunnel.

  • OutboundPortIndex and OutboundPortName have a one-to-one mapping: 0 maps to eth0, and 2 maps to lte.

Valid values:

  • eth0 :

    eth0

  • lte :

    lte

eth0

RegionId

string

Yes

The region ID of the Smart Access Gateway instance.

cn-shanghai

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

Id of the request

E93884AC-6C21-4FEA-8E3A-7377D33B194F

Success

boolean

Indicates whether the request is successful.

true

Code

string

The error code. A value of 200 indicates that the task is successful.

200

Message

string

The returned message.

Successful

HttpStatusCode

integer

The HTTP status code.

200

Data

object

The response data.

InstanceId

string

The instance ID.

sagv3dnsforward-nc7qabskj17werc7su

Domain

string

The domain name.

yfiy.cn

MasterIp

string

The primary DNS server.

14.104.81.13

SlaveIp

string

The secondary DNS server.

172.16.0.14

Mode

string

The forwarding mode.

first

OutboundPortType

string

The outbound port type.

PhysicalPort

OutboundPortIndex

integer

The outbound port index.

0

OutboundPortName

string

The outbound port.

eth0

Examples

Success response

JSON format

{
  "RequestId": "E93884AC-6C21-4FEA-8E3A-7377D33B194F",
  "Success": true,
  "Code": "200",
  "Message": "Successful",
  "HttpStatusCode": 200,
  "Data": {
    "InstanceId": "sagv3dnsforward-nc7qabskj17werc7su",
    "Domain": "yfiy.cn",
    "MasterIp": "14.104.81.13",
    "SlaveIp": "172.16.0.14",
    "Mode": "first",
    "OutboundPortType": "PhysicalPort",
    "OutboundPortIndex": 0,
    "OutboundPortName": "eth0"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidSpec.FeatureNotSupport The current edition of the cloudbranch does not support this feature.
400 GATEWAY.InvalidSN The specified gateway serial number does not exist.
400 CCN.DuplicateDNSForwardingDomain Duplicate DNS forwarding domain
400 ConfigUnsynchronized The configs of device are unsynchronized,please check whether the device is online
400 DeviceNotExist The specified device does not exist
400 FeatureNotSupport The current edition of the smart access gateway does not support this feature.
400 CCN.DNS.Forward.CreateFailed failed to create dns forward config
404 ResourceNotFound.Device The specified resource of Device is not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.