All Products
Search
Document Center

:Does Alibaba Cloud CDN support wildcard domain names?

Last Updated:Aug 01, 2023

Alibaba Cloud CDN supports wildcard domain names. This topic introduces wildcard domain names and describes how to add a wildcard domain name to Alibaba Cloud CDN.

What is acceleration of wildcard domain names?

Acceleration of wildcard domain names is the acceleration of domain names that match a specified wildcard domain name. You can add a wildcard domain name to Alibaba Cloud CDN, and then domain names that match the wildcard domain name are accelerated. For example, .aliyundoc.com is a wildcard domain name. example.aliyundoc.com is a second-level domain name of .aliyundoc.com. image.developer.aliyundoc.com is a third-level domain name of .aliyundoc.com.

For example, .aliyundoc.com is added to Alibaba Cloud CDN as a wildcard domain name. After .aliyundoc.com is mapped to the CNAME that is assigned by Alibaba Cloud CDN, all domain names that match .aliyundoc.com, such as example.aliyundoc.com and demo.aliyundoc.com, are mapped to the CNAME of .aliyundoc.com, and accelerated by Alibaba Cloud CDN.

Important
  • Alibaba Cloud CDN only accelerates second-level domain names that match the wildcard domain name. For example, example.aliyundoc.com that matches.aliyundoc.com can be accelerated but image.developer.aliyundoc.com cannot be accelerated. If a request to image.developer.aliyundoc.com is sent to an Alibaba Cloud CDN point of presence (POP), the POP rejects the request and returns the HTTP 403 status code.

  • Alibaba Cloud CDN identifies .com.cn, .net.cn, .gov.cn, edu.cn, and .org.cn as top-level domain names. For example, .aliyundoc.com.cn is a wildcard domain name. In this case, example.aliyundoc.com.cn is a second-level domain name and image.developer.aliyundoc.com.cn is a third-level domain name.

  • When you refresh or prefetch content from an origin server based on URLs or directories, the URLs or directories cannot be the URLs or directories of a wildcard domain name. You need to specify URLs or directories of a specific domain name. For example, http://.aliyundoc.com/example/b.mp4 is not supported but http://example.aliyundoc.com/example/b.mp4 is supported.

Rules for adding wildcard domain names

When you add a wildcard domain name to Alibaba Cloud CDN, take note of the following rules:

  • The wildcard domain name must be less than 100 bytes in length.

  • A wildcard domain name can be in one of the following formats: .aliyundoc.com and *.aliyundoc.com. Both formats produce the same result. In this example, .aliyundoc.com is displayed in the console regardless of the format that is used.

  • Alibaba Cloud CDN supports top-level, second-level, and third-level wildcard domain names. A third-level domain name contains three periods, such as *.example.aliyundoc.com.

  • You are charged data transfer fees for domain names that are matched by wildcard domain names in the same manner as specific domain names. Data usage generated by domain names that are matched by wildcard domain names is summarized and displayed on the Resource Monitoring page of the Alibaba Cloud CDN console. Alibaba Cloud CDN considers each wildcard domain name as an individual accelerated domain name. Therefore, Alibaba Cloud CDN provides the billing details of wildcard domain names (accelerated domain names) instead of the domain names that match the wildcard domain names.

Logs of wildcard domain names

A log file is generated for each wildcard domain name at each time interval. The log file contains log data of all domain names that match the wildcard domain name. For more information about logs, see Log management.

Procedure

  1. Log on to the Alibaba Cloud CDN console.

  2. Add a wildcard domain name to Alibaba Cloud CDN. For more information, see Add a domain name.