All Products
Search
Document Center

:Does Alibaba Cloud CDN support wildcard domain names?

Last Updated:Jul 27, 2026

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?

Wildcard domain name acceleration uses a wildcard (*) in an accelerated domain name to deliver content for all matching second-level subdomains. For example, *.aliyundoc.com is a wildcard domain name, example.aliyundoc.com is a second-level subdomain of this wildcard domain name, and image.developer.aliyundoc.com is a third-level subdomain of this wildcard domain name.

For example, you add *.aliyundoc.com as an accelerated domain name. After you map the wildcard domain name *.aliyundoc.com to the CNAME provided by Alibaba Cloud CDN, requests for its second-level subdomains, such as example.aliyundoc.com and demo.aliyundoc.com, are resolved to the CNAME for the wildcard domain name *.aliyundoc.com and then accelerated.

Important
  • Alibaba Cloud CDN accelerates only the second-level subdomains that match the wildcard domain name. Subdomains at lower levels are not accelerated. For example, the second-level subdomain example.aliyundoc.com of the wildcard domain name *.aliyundoc.com can be accelerated. However, the third-level subdomain image.developer.aliyundoc.com cannot be accelerated. If a request for image.developer.aliyundoc.com is sent to a point of presence (POP), the POP rejects the request and returns an HTTP 403 status code.

  • Alibaba Cloud CDN recognizes domain suffixes on the public suffix list, such as .com.cn, .net.cn, .gov.cn, .edu.cn, and .org.cn, as root domains. For the full list, see https://publicsuffix.org/list/public_suffix_list.dat. For example, *.aliyundoc.com.cn is a wildcard domain name, example.aliyundoc.com.cn is a second-level subdomain of this wildcard domain name, and image.developer.aliyundoc.com.cn is a third-level subdomain of this wildcard domain name.

  • You cannot use URLs or directories that contain wildcards when you purge or prefetch content. You must specify the exact URL or directory of a specific domain name, including second-level subdomains. For example, purging or prefetching http://*.aliyundoc.com/example/b.mp4 is not supported, but purging or prefetching http://example.aliyundoc.com/example/b.mp4 is supported.

Origin fetch and matching rules

For origin fetch to work with a wildcard domain name, the domain only needs to resolve to Alibaba Cloud CDN through a CNAME record and have a corresponding origin server configured. Mapping to the specific CNAME in the console is not required.

The configuration for an exact domain name takes precedence over a matching wildcard domain name configuration. For example, if you configure both the wildcard domain name *.aliyundoc.com and the exact domain name example.aliyundoc.com, requests to example.aliyundoc.com match the configuration of the exact domain name.

Rules for adding wildcard domain names

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

  • The full domain name, such as image.example.com, cannot exceed 100 characters.

  • The subdomain (the part of the domain name without the root domain) cannot exceed 64 characters. For example, for the domain name image.example.com, the subdomain is image and the root domain is example.com.

  • You can add a wildcard domain name in either of the following formats: *.aliyundoc.com and *.aliyundoc.com. Both formats produce the same result. After the domain name is added, it is displayed as *.aliyundoc.com in the console.

  • Alibaba Cloud CDN supports multi-level wildcard domain names, such as *.example.aliyundoc.com, *.image.example.aliyundoc.com, and *.cat.image.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 Overview.

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.