Dynamic Route for CDN (DCDN) supports wildcard domain names. This topic introduces wildcard domain names and describes how to add a wildcard domain name to DCDN.
What does the acceleration feature for wildcard domain names do?
Wildcard domain name acceleration uses a wildcard character (*) in an accelerated domain name to accelerate all its corresponding second-level domains. For example, *.aliyundoc.com is a wildcard domain name, developer.aliyundoc.com is a second-level domain of this wildcard domain name, and image.developer.aliyundoc.com is a third-level domain.
Example: You add the wildcard domain name
.aliyundoc.com as an accelerated domain name. After you create a CNAME record to map this domain name to the one provided by DCDN, DCDN accelerates all its second-level domains, such as example.aliyundoc.com and demo.aliyundoc.com.- Scenario 1: To accelerate only a few second-level domains, add them individually as service domain names. For more information, see Add a service domain name.
- Scenario 2: To accelerate most of your second-level domains but exclude a few, do not create CNAME records for the excluded domains in your DNS settings.
Important
- After you add a wildcard domain name in the DCDN console, if the system indicates that a CNAME record is not configured, you must create a CNAME record for the wildcard domain name in your DNS settings.
- DCDN does not support wildcard domain name acceleration for domains below the second level. For example, for the wildcard domain name
*.aliyundoc.com, the third-level domainimage.developer.aliyundoc.comcannot be accelerated by DCDN. - You cannot use wildcard URLs or directories with the refresh or prefetch features. However, you can refresh or prefetch content for specific URLs and directories on an exact second-level domain. For example, you cannot refresh or prefetch
http://*.aliyundoc.com/a/lesson-01.mp4, but you can refresh or prefetchhttp://example.aliyundoc.com/a/lesson-01.mp4.
Rules for adding wildcard domain names
The following rules apply:
- An accelerated domain name must be less than 100 bytes in length.
- You can add a wildcard domain name in two formats:
.aliyundoc.comand*.aliyundoc.com. Both formats are equivalent. After you add the domain name, the DCDN console displays it as.aliyundoc.com. - DCDN supports up to third-level wildcard domains, which means the domain name can contain up to three periods (.). For example,
*.developer.aliyundoc.com. - Traffic for all second-level domains that match the wildcard is billed in the same way as traffic for a standard accelerated domain name. On the resource monitoring page, DCDN aggregates traffic data under the wildcard domain name. You are billed for each wildcard domain name as a single accelerated domain name, and DCDN does not provide separate billing data for each individual second-level domain.
Logs of wildcard domain names
For each time interval, DCDN generates a single offline log for each wildcard domain name. This log contains data for all matching accelerated second-level domains. For more information about log data, see Fields in offline logs.
Procedure
- Log in to the DCDN console.
- Add the wildcard domain name as an accelerated domain name. For detailed instructions, see Add a service domain name.