Object Storage Service (OSS) uses data centers distributed around the globe to implement transfer acceleration. When a request is sent to your bucket, the request is parsed and routed to the data center where the bucket is located over the optimal network path and protocol. The transfer acceleration feature provides an optimized end-to-end acceleration solution to accessing OSS over the Internet. This topic describes how to implement OSS transfer acceleration based on a custom domain name.

Prerequisites

  • Transfer acceleration is enabled. For more information, see Enable transfer acceleration.
  • An Internet Content Provider (ICP) filing is approved by the Ministry of Industry and Information Technology (MIIT) for the domain name that you want to map to a bucket in a Chinese mainland region. For more information, see ICP filing.

Background information

After transfer acceleration is enabled, two acceleration endpoints are generated for the bucket.
  • Global acceleration endpoint: The format is BucketName.oss-accelerate.aliyuncs.com. Transfer acceleration access points are distributed across the world. You can use this endpoint to accelerate access to the bucket from all OSS regions.
  • Acceleration endpoint outside the Chinese mainland: The format is BucketName.oss-accelerate-overseas.aliyuncs.com. Transfer acceleration access points are distributed across regions outside the Chinese mainland. Users outside the Chinese mainland can use this domain name to accelerate access to the bucket in regions outside the Chinese mainland.
Important You are charged additional fees based on the traffic and region where transfer acceleration is used. For more information, see Transfer acceleration fees.

If you want to accelerate access to a bucket through a custom domain name, you must map the custom domain name to the bucket and add a CNAME record that points to the acceleration endpoint.

Procedure

  1. Map a custom domain name to the bucket.
    1. Log on to the OSS console.
    2. In the left-side navigation pane, click Buckets. On the Buckets page, click the name of the desired bucket.
    3. In the left-side navigation tree, choose Bucket Settings > Domain Names.
    4. On the Domain Names page, click Map Custom Domain Name.
    5. In the Map Custom Domain Name panel, enter the domain name that you want to map in the Custom Domain Name field.
      Important Do not turn on Add CNAME Record Automatically.

      If a domain conflict message appears, the domain name has been mapped to another bucket. To resolve this issue, you can map another domain name to the bucket or verify the ownership of the domain name to forcibly map the domain name to the bucket. This operation removes the mapping between the domain name and the previous bucket. For more information, see Verify the ownership of a domain name.

    6. Click Submit.
  2. Add a CNAME record.
    Add a CNAME record to the DNS service provided by your domain name provider. The following steps show how to add a CNAME record for a domain name to Alibaba Cloud DNS records:
    1. Log on to the Alibaba Cloud DNS console.
    2. On the Domain Name Resolution page, find the domain name and click DNS Settings in the Actions column.
    3. On the DNS Settings page, click Add DNS Record. In the Add DNS Record panel, configure the parameters described in the following table.
      Parameter Description
      Record Type The type of the record that you want to add. Select CNAME from the Record Type drop-down list.
      Hostname The host record based on the prefix of the domain name.
      • To add a root domain such as aliyun.com, enter @.
      • To add a subdomain name, enter the prefix of the second-level domain. For example, if the domain name is help.aliyun.com, enter help.
      • To map all subdomain domains to the domain name of the bucket, enter *.
      DNS Request Source The resolution line that is used to resolve the domain name. To allow the system to select the optimal line, we recommend that you select Default for this parameter.
      TTL Period Enter the OSS acceleration endpoint. Enter the global acceleration endpoint or acceleration endpoint for regions outside the Chinese mainland as needed.
      TTL Select the update interval of the record. In this example, use the default value.
    4. Click OK.

Verify the CNAME status

The time period required for the record to take effect varies based on the DNS providers. You can use the following methods to verify whether the configurations take effect:
  • Windows
    Open the cmd.exe program. Run the nslookup command to resolve your custom domain name. If the request is redirected to the acceleration endpoint, the domain name mapping is in effect.
  • Linux
    Run the dig command to resolve your custom domain name. If the request is redirected to the acceleration endpoint, the domain name mapping is in effect.