All Products
Search
Document Center

PolarDB:Private domain names

Last Updated:Apr 18, 2024

If you use domain names to connect to databases and you want to retain the domain names after the databases are migrated to the cloud, you can bind the private domain names by using the private domain name feature.

Scenarios

You can bind a private domain name to each private endpoint of a PolarDB cluster. Private domain names take effect in only the VPC that you specify in the current region. Private domain names have a higher priority than global domain names in domain name resolution.

For example, the original domain name of a database is developer.aliyundoc.com, and the database is migrated to a PolarDB cluster. The endpoint of the PolarDB cluster is image.developer.aliyundoc.com. To retain the original domain name, you can create a CNAME record for the private domain name developer.aliyundoc.com and bind the domain name to image.developer.aliyundoc.com. After the domain name is bound to the endpoint, you can access the PolarDB cluster by visiting developer.aliyundoc.com in the specified VPC, as shown in the following figure.

私有域名应用场景

Billing

The private domain name feature of PolarDB maps the private domain names that are managed by PrivateZone to the private endpoints of a PolarDB cluster. You are charged only a small amount of fees for PrivateZone. For more information, see Pricing.

Bind a private domain name

  1. Log on to the PolarDB console.

  2. In the left-side navigation pane, click Clusters.

  3. In the upper-left corner, select the region where the cluster to which you want to connect is deployed.

  4. Find the cluster and click its ID.

  5. In the Database Connections section of the Basic Information page, click the 切换 icon in the upper-right corner to change the view.

  6. Click Bind Private Domain Name next to the target private endpoint.

    绑定私有域名

  7. In the Bind Private Domain Name dialog box, specify the prefix and suffix of the private domain name.

    私有域名前缀和Zone

    The format of the private domain name is <prefix>.<suffix>. The following table describes the format of the private domain names.

    Configuration

    Description

    Prefix of a private domain name

    The prefix of the private domain name must be 6 to 40 characters in length and can contain at least one of the following types of characters: lowercase letters, digits, and hyphens (-). The prefix must start with a letter and end with a digit or a letter.

    Suffix of the private domain name (zone)

    You can select an existing zone from the drop-down list or enter a new zone. For more information about zones, see PrivateZone.

    Note
    • If the VPC where your PolarDB cluster resides is not in the configured zone, the system automatically binds the VPC to the zone.

    • You can view and manage zones in the PrivateZone console.

    Note

    When you bind a private domain name, the system automatically creates the AliyunServiceRoleForPolarDB role. For more information, see Service-linked roles for PolarDB .

  8. Click OK.

  9. In the Bind Private Domain Name dialog box, confirm the domain name information and click OK.

Related API operation

API

Description

ModifyDBEndpointAddress

Modifies the endpoints of a PolarDB cluster, including the primary endpoint, default cluster endpoint, custom cluster endpoint, and private domain name.