All Products
Search
Document Center

Smart Access Gateway:AddSmartAccessGatewayDnsForward

Last Updated:Jul 31, 2025

Adds DNS forwarding configurations to an SCG5000 or SCG5000-5G instance. The device version must be 3.4.2 or later.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
smartag:AddSmartAccessGatewayDnsForward
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
SagInsIdstringYes

The ID of the instance.

sag-v9un1ccz22owd76lf8
SagSnstringYes

The serial number (SN) of the device.

sagf4dkqh78
DomainstringYes

The domain name.

Note
  • Wildcard domain names are supported. You can use the wildcard character asterisk (*) to specify a wildcard domain name.

For example, you can enter *.baidu.com to specify the domain name baidu.com.

www.aliyun.com
MasterIpstringYes

The primary DNS server.

114.114.114.114
SlaveIpstringNo

The secondary DNS server.

172.16.0.14
ModestringNo

The forwarding mode.

Note
  • This parameter is not in use. Ignore this parameter.
first
OutboundPortTypestringNo

The type of the egress port.

Note
  • A value of Tunnel specifies a tunnel, and a value of PhysicalPort specifies a physical port.
Enumeration Value:
  • Tunnel: Tunnel.
  • PhysicalPort: PhysicalPort.
  • None: None.
Tunnel
OutboundPortIndexstringNo

The number of the egress port.

Note
  • This parameter is optional if OutboundPortType is set to PhysicalPort. Ignore this parameter if OutboundPortType is set to Tunnel.
  • The value of OutboundPortIndex is the unique index of the port name specified by poOutboundPortName. For example, 0 is the index for the port named eth0, and 2 is the index for the port named lte.
0
OutboundPortNamestringNo

The egress port.

Note
  • This parameter is optional if OutboundPortType is set to PhysicalPort. Ignore this parameter if OutboundPortType is set to Tunnel.
  • The value of OutboundPortIndex is the unique index of the port name specified by poOutboundPortName. For example, 0 is the index for the port named eth0, and 2 is the index for the port named lte.
eth0
RegionIdstringYes

The ID of the region where the instance is deployed.

cn-shanghai

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

Id of the request

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

Indicates whether the request is successful.

true
Codestring

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

200
Messagestring

The response message.

Successful
HttpStatusCodeinteger

The HTTP status code.

200
Dataobject

The information returned for the request.

InstanceIdstring

The ID of the instance.

sagv3dnsforward-nc7qabskj17werc7su
Domainstring

The domain name.

yfiy.cn
MasterIpstring

The primary DNS server.

14.104.81.13
SlaveIpstring

The secondary DNS server.

172.16.0.14
Modestring

The forwarding mode.

first
OutboundPortTypestring

The type of the egress port.

PhysicalPort
OutboundPortIndexinteger

The number of the egress port.

0
OutboundPortNamestring

The egress port.

eth0

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InvalidSpec.FeatureNotSupportThe current edition of the cloudbranch does not support this feature.-
400GATEWAY.InvalidSNThe specified gateway serial number does not exist.-
400CCN.DuplicateDNSForwardingDomainDuplicate DNS forwarding domain-
400ConfigUnsynchronizedThe configs of device are unsynchronized,please check whether the device is online-
400DeviceNotExistThe specified device does not exist-
400FeatureNotSupportThe current edition of the smart access gateway does not support this feature.The current version of Smart Access Gateway does not support this feature.
400CCN.DNS.Forward.CreateFailedfailed to create dns forward config-
404ResourceNotFound.DeviceThe specified resource of Device is not found.-

For a list of error codes, visit the Service error codes.