When built-in geographic or ISP-based resolution lines do not provide enough granularity, custom lines (Custom ACLs) let you direct DNS responses based on specific IP address ranges. Configure a custom line to return a designated IP address for DNS queries that originate from a specified IPv4 range.
How custom lines work
When a DNS query reaches the Alibaba Cloud DNS authoritative server, the server selects a resolution line based on the source IP address:
Default behavior: The Public Zone service performs intelligent DNS scheduling based on the egress IP address of the client's local DNS server.
EDNS-Client-Subnet (ECS) support: If the client's local DNS server supports EDNS-Client-Subnet (ECS), the Public Zone service performs intelligent DNS scheduling based on the client's CIDR block. This provides more accurate routing because the authoritative server sees the actual client subnet rather than the resolver's IP address.
After you define a custom line with a specific IP address range, any DNS query whose source IP falls within that range matches the custom line. Queries that do not match any custom line are resolved by the default resolution line.
Custom lines support only IPv4 addresses. IPv6 addresses are not supported.
Prerequisites
Before you begin, ensure that you have:
The Public Authoritative Zone service upgraded to the Ultimate Edition or later
Create a custom line
Go to the Alibaba Cloud DNS - Public Authoritative Zone page and click Settings for the target domain name.
Switch to the Custom ACLs tab.

Click Add Custom ACLs and enter an ACL Name and an IP Address Range.
ACL Name: A descriptive name for the custom line, such as
Office-NetworkorVPN-Users.IP Address Range: The IPv4 address range to match against incoming DNS queries. Specify the range in start IP – end IP format, for example,
1.0.0.1-2.1.1.2.

Configure a DNS record for the custom line
After creating a custom line, associate it with a DNS record so that matching queries resolve to a specific IP address.
Go to the Alibaba Cloud DNS - Public Authoritative Zone page and click Settings for the target domain name.
Add a DNS record. Set Query Source to Custom ACLs, and then select the custom line that you created.

Complete the remaining record fields (record type, hostname, and record value), and then save the record.