This topic describes how to add custom resolution records.
On the Custom Resolution page, click Add Custom Resolution to add a custom resolution record for a domain name.
Add a rule policy
In the panel that appears, set the Policy Type parameter to Rule Policy to add a rule policy.
Configure the parameters.
Basic information
Parameter | Description |
Domain Name | The domain name that you want to resolve. Example: www.aliyun.com. Note
|
ISP Line | The line settings based on your Internet service provider (ISP) and region.
Note For the same domain name in one region, the line settings take effect in the following order of priority: ISP > Geographical Location > Default. For example: China Telecom-Beijing > China Telecom-Default > Default-Beijing > Default-Default. If two rule policies are created for the same domain name with lines set to China Telecom-Beijing and China Telecom-Default, China Telecom-Beijing takes precedence for China Telecom users in Beijing. This means that the rule policy with the China Telecom-Beijing line is applied to the users. |
Custom resolution rules
You can configure up to 10 custom resolution rules for a rule policy.
Parameter | Description |
Rule Name | The name of the rule, which can be used to describe the purpose of the rule. Example: Perform scheduling using SDK versions. |
Rule Sorting | The order of multiple rules, which can be adjusted. The matching logic follows a top-down sequential process. The order determines which rule is matched first. After you adjust the order, the system applies the rules in the new order. |
SDNS Parameter Configuration | The configurations used to match the software-defined DNS (SDNS) parameters carried in client requests. If a rule is matched, the system returns the resolution record value of the rule. For more information about the matching logic, see Matching logic of a custom resolution rule .
Note
|
Resolution Record Value | The set of returned values for custom resolution. Each record value indicates a record in the resolution record set. This parameter is required.
You can add multiple record values. If you disable weight settings, multiple record values are merged and returned. To perform scheduling based on weights, you must turn on the corresponding switch. After you turn on the switch, you can specify a weight for each record value. The weight value ranges from 1 to 100. An appropriate record value is returned using a load balancing algorithm based on the weight of the record value. Note You can add up to 10 record values to a rule. |
TTL | Required. The validity period of the custom resolution record. A shorter validity period results in quicker expiration of the resolution record cache in the HTTPDNS SDK. Meanwhile, the frequency at which the HTTPDNS SDK requests new resolution records increases. |
Test the rule policy
On the Add Rule Policy page, you can validate the rule as shown in the following figure.
In the dialog box that appears, configure the parameters to check whether the rule policy meets your business requirements.

Add a Function Compute policy
Prerequisites
A function is created and published in the Function Compute console. For more information, see Create a Function Compute service .
You must authorize the service-linked role. For more information, see Grant a service-linked role.
In the Add Custom Resolution panel, set the Policy Type parameter to Function Compute Policy to add a custom resolution Function Compute policy.

Configure the parameters.
Parameter | Description |
Region | Required. Select the region where the Function Compute service resides. If you create a Function Compute service in the Shanghai region, select Shanghai. |
FC Version | Both FC 2.0 and FC 3.0 function configurations are supported. The default is FC 3.0, which is recommended. Differences and compatibility between Function Compute 3.0 and 2.0 |
Service | Required. Select the Function Compute service that is created in the selected region. This field is available only for FC 2.0. |
Service Version/Alias | Required. Select the version or alias of the Function Compute service. This field is available only for FC 2.0. Note We recommend that you do not select the LATEST version of Function Compute. |
Custom Resolution Function in the BEFORE_READ_CACHE Phase | During the hook stage before the cache is read from the HTTPDNS server, you can configure a Function Compute function at this phase. You can also leave the hook functionality for this phase inactive. |
Custom Resolution Function in the BEFORE_WRITE_CACHE Phase | During the hook stage after recursive resolution by the HTTPDNS server but before writing to the cache, you can configure a Function Compute function at this phase. You can also leave the hook functionality for this phase inactive. |
Custom Resolution Function in the BEFORE_WRITE_RESPONSE Phase | During the hook stage after the HTTPDNS server writes to the cache but before constructing the response content, you can configure a Function Compute function at this phase. You can also leave the hook functionality for this phase inactive. |
Hook Unit Testing | Test the connectivity between HTTPDNS and the Function Compute service:
|
After you complete the configurations, click OK to return to the policy list.
For more information about how to enable, disable, and delete a policy, see Manage custom resolution policies.