After migrating a database to PolarDB, you can continue using its original domain name by binding it as a private domain name.
Use cases
Each VPC-facing endpoint of PolarDB can be bound to a private domain name, which takes effect only in the specified VPC within the current region. Private domain names have a higher priority than global domain names and are resolved first.
For example, if the domain name of your original database is developer.aliyundoc.com and you migrate the database to a PolarDB cluster, the connection address of the PolarDB cluster is image.developer.aliyundoc.com. To continue using the original domain name, you can create a private domain name to bind developer.aliyundoc.com to image.developer.aliyundoc.com by using a CNAME record. After the binding is successful, you can access the PolarDB cluster by accessing developer.aliyundoc.com from the specified VPC, as shown in the following figure.

Billing
The private domain name feature for PolarDB uses PrivateZone to map a private domain name to a cluster's VPC-facing endpoint. PrivateZone usage may incur a small fee. For more information, see Pricing.
Bind a private domain name
-
Log on to the PolarDB console. In the left-side navigation pane, click Clusters, select the region where the cluster resides, and then click the cluster ID.
-
On the Basic Information page, in the Database Connections section, click the
icon in the upper-right corner to switch the view. -
To the right of the target VPC-facing endpoint, click Bind Private Domain Name.
The Bind Private Domain Name option appears to the right of VPC-facing endpoints in both the primary endpoint and cluster endpoint sections.
-
In the Bind Private Domain Name dialog box, enter a prefix and suffix for the private domain name. The format of the private domain name is
<prefix>.<suffix>. For more information, see the following table:Parameter
Description
private domain name prefix
The prefix must be 6 to 40 characters long, start with a letter, end with a letter or a digit, and contain only lowercase letters, digits, and hyphens (-).
zone
You can select an existing zone from the drop-down list or enter a new one. For more information about zones, see PrivateZone.
Note-
If the VPC that contains PolarDB is not in the configured zone, the system automatically binds the VPC to the zone.
-
You can view and manage zones in the Alibaba Cloud DNS console.
NoteWhen you bind a private domain name, the system automatically creates a service-linked role named
AliyunServiceRoleForPolarDB. For more information, see PolarDB service-linked role. -
-
Click OK.
-
In the Bind Private Domain Name dialog box, confirm that the domain information is correct, and then click OK.
API reference
|
API |
Description |
|
Modifies the endpoints of a PolarDB cluster, including the primary endpoint, the default cluster endpoint, custom cluster endpoints, and private domain names. |