All Products
Search
Document Center

PolarDB:Private domain names

Last Updated:Oct 12, 2023

Assume that you use domain names to connect to databases and you want to retain the original domain names of the databases after the databases are migrated to the cloud. In this case, you can bind the private domain names by using the private domain name feature.

Scenarios

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

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

Scenario of the private domain name

Billing description

The private domain name feature of PolarDB for MySQL is realized by mapping the private domain names that are managed by PrivateZone to the VPC-facing endpoints of PolarDB for MySQL. PrivateZone charges a small amount of fee. For more information about pricing, see Pricing.

Bind a private domain name

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the upper-right corner of the URL section on the Basic Information page, click the Switch icon to switch the view.
  5. On the right side of the VPC-facing endpoint, click Bind Private Domain Name.
    Bind the private domain name
  6. In the Bind Private Domain Name dialog box, enter the prefix and the suffix of the private domain name.
    Prefix of a domain name and a zone

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

    ConfigurationDescription
    Prefix of a private domain nameThe 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 for MySQL cluster resides is not in the configured zone, the system automatically binds the VPC to the zone.
    • You canview and manage zones in the PrivateZone console.
    Note When you bind a private domain name, the system automatically creates an AliyunServiceRoleForPolarDB role. For more information, see Service-linked roles for PolarDB.
  7. Click OK.
  8. In the Bind Private Domain Name dialog box, confirm the information about the domain name again and click OK.

Related API operations

APIDescription
ModifyDBEndpointAddressModifies the endpoints of a PolarDB for MySQL cluster, including the primary endpoint, default cluster endpoint, custom cluster endpoint, and private domain name.