All Products
Search
Document Center

HTTPDNS:Overview

Last Updated:Feb 13, 2026

This topic describes the principles and workflow of the HTTPDNS custom resolution feature.

Introduction to custom resolution

In certain business scenarios, you may want to return specific resolution results for a domain name. The HTTPDNS custom resolution feature lets you configure rules or use Function Compute to customize the resolution for specific domain names.

When you use DNS over HTTPS (DoH), custom resolution is not supported for the resolved domain names.

Scenarios

  • Grayscale testing: Assume your domain name is www.example.com. To support business growth, you have released a new service with the IP address 1.1.X.X. Before a full release, you want to perform grayscale testing on traffic from China Telecom_Shanghai for a specific app version number. For this traffic, domain name resolution requests for www.example.com must return 1.1.X.X.

  • Traffic rerouting: Assume an automotive company's service domain name is www.example.com. The company wants to return the IP addresses of servers in different regions based on specific business logic. For example, you can return different service IP addresses based on a car's home region. If a car's home region is Guangzhou, DNS query requests for www.example.com from that car must return the IP address of a server in Guangzhou.

Workflow

1. Add a domain name

  • Log on to the EMAS console.

  • Choose HTTPDNS > Resolution Management > Domain Names, and add a domain name for resolution.image

2. Add a custom resolution policy

  • Choose Resolution Management > Custom Resolution, and click the Add Custom Resolution button.image

  • Select the domain name, and then select and configure a policy type based on your requirements:

3. (Optional) Pass custom parameters from the client

  • When you send a request using the HTTPDNS software development kit (SDK) or HTTP API, you can include custom resolution parameters to execute more granular routing logic. For more information, see Pass custom resolution parameters from the client.

4. Enable the policy

After you add a policy, it does not take effect immediately. In the policy list, turn on the switch in the Status column to enable the policy.

Important

Enabling a policy is a critical operation. A confirmation dialog box is displayed. A risk control verification may also be triggered, which requires you to enter a CAPTCHA.

image

5. Verify the resolution result

After the configuration is complete, you can use the online test tool to verify the resolution result. For more information, see Test a custom resolution function online.

6. (Optional) Manage custom resolution policies

After you add a custom resolution policy, you can perform operations such as disabling or deleting the policy. For more information, see Manage custom resolution policies.

Policy details

Recommended scenarios

  • When to use a rule-based policy: Use this policy type for scenarios with clear requirements and simple logic, such as routing by carrier, region, or device type. This policy is ideal when real-time dynamic calculations are not required.

  • When to use a Function Compute-based policy: Use this policy type for complex logic, such as load balancing, real-time data-driven decisions, or decisions based on multiple conditions.

Rule-based policy

A rule-based policy customizes resolution based on specific rules. You can configure routing rules with greater precision. By configuring different resolution parameters, you can accurately route user traffic from different carriers and regions to specific endpoints.

The procedure is as follows:

  • In the HTTPDNS console, create a custom rule-based resolution policy for a specific domain name.

  • When the client sends a DNS query request through the SDK or HTTP API, include the corresponding custom resolution parameters.

  • When the HTTPDNS server receives the request, it returns a resolution result that matches the preset rules and meets your business requirements.

For configuration details, see Configure rule-based custom resolution.

The following figure shows the resolution flow for a rule-based policy.

Function Compute-based policy

A Function Compute-based policy uses Alibaba Cloud Function Compute to schedule domain name access traffic. This method is more flexible than a rule-based policy. You can implement your business logic as a function in Function Compute and then configure that function as a resolution hook. This lets you address more complex business requirements. For configuration details, see Configure Function Compute-based custom resolution.

The following figure shows how Function Compute works.

image

Relationship between rule-based and Function Compute-based policies

image