All Products
Search
Document Center

Cloud Firewall:CreatePrivateDnsEndpoint

Last Updated:Oct 27, 2025

Creates a private DNS endpoint.

Operation description

You can call the CreatePrivateDnsEndpoint operation to create a private Domain Name System (DNS) endpoint.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

AccessInstanceName

string

Yes

The name of the private instance.

测试

PrivateDnsType

string

Yes

The type of the private DNS. Valid values:

  • PrivateZone

  • Custom (default)

Custom

RegionNo

string

Yes

The region ID of the instance.

cn-hangzhou

VpcId

string

Yes

The ID of the VPC instance.

vpc-uf6b5lyul0x******

PrimaryVSwitchId

string

No

The ID of the primary vSwitch.

vsw-uf6b0dkyryer8******

StandbyVSwitchId

string

No

The ID of the standby vSwitch.

vsw-8vb6jk75wfcwn******

PrimaryVSwitchIp

string

No

The IP address of the primary vSwitch.

10.1.1.1

StandbyVSwitchIp

string

No

The IP address of the standby vSwitch.

10.2.2.2

IpProtocol

string

No

The IP protocol. Valid values:

  • TCP

  • UDP

UDP

Port

integer

No

The port number.

80

FirewallType

array

Yes

The type of the Cloud Firewall. Valid values:

  • internet

  • vpc

  • nat

string

No

The type of the Cloud Firewall. Valid values:

  • internet

  • vpc

  • nat

[ "internet", "vpc", "nat" ]

PrimaryDns

string

No

The primary DNS server.

1.1.1.1

StandbyDns

string

No

The standby DNS server.

1.1.1.2

MemberUid

integer

No

The UID of the member account.

258039427902****

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The ID of the request.

850A84D6************00090125EEB1

AccessInstanceId

string

The ID of the instance.

pd-12345

TaskId

string

The unique ID of the task.

132

Examples

Success response

JSON format

{
  "RequestId": "850A84D6************00090125EEB1",
  "AccessInstanceId": "pd-12345",
  "TaskId": "132"
}

Error codes

HTTP status code

Error code

Error message

Description

400 ErrorPrivateDnsType private dns type error. Private DNS type error
400 ErrorPrivateDnsPrivateZoneConfigure private dns parameter error. Private DNS configuration parameter error
400 ErrorVswitchId vswitch id error. Switch Error
400 ErrorVswitchIpAddress vswitch ip error. Switch IP Error
400 ErrorPrivateDnsIpAddress private dns ip address error. Private DNS IP Error
400 ErrorVswitchNoAvailableIP the vswitch has no available ip. No IP available for the specified switch
400 ErrorVfwVpcNoAvailable the vpc is cloud firewall vpc, please reselect vpc. The specified VPC is automatically created by Cloud Firewall. Select a new VPC.
400 ErrorProxyVswitchNoAvailable the vswitch is cloud firewall vswitch, please reselect vswitch. The specified switch is a switch automatically created by the NAT firewall, please reselect the switch
400 ErrorFirewallTypeDuplicates firewallType duplicates. Private DNS endpoint already exists for selected firewall boundary
400 ErrorPrivateDnsIpSame the primary and backup DNS IP cannot be the same. The primary and secondary IP addresses of a private DNS cannot be the same.
400 ErrorPrivateDnsEndpointQuotaExceeded Private DNS endpoint resource exceeds the quota limit. The resources of the private network DNS synchronization node exceed the quota limit.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.