Skip to content

IP Alias

SmartDNS provides IP address alias mapping, which can map the IP or IP range in the query result to a specific IP address.
This feature can be used for CDN network acceleration with anycast IP, such as Cloudflare's CDN acceleration.

IP Alias Mapping

Map the specified IP address to the target address, such as mapping the C class address of to


Ignore IP Alias for Specific Domains

In some cases, it may be necessary to exclude specific domains from IP alias mapping. This can be achieved by using domain rules to ignore IP alias mapping for those domains.

domain-rules / -no-ip-alias

Cloudflare CDN Acceleration

Cloudflare CDN's IP addresses are all anycast IP addresses, and users can access websites hosted on Cloudflare through any Cloudflare IP address.
With this feature, we can find the fastest IP address for accessing Cloudflare CDN on our own network and set up IP aliases to speed up all websites hosted on Cloudflare.

Here are the steps:

Get the IP address range of Cloudflare and save it as an IP list file

Cloudflare has publicly disclosed the IP address range of its CDN, which can be found here:


Save the above list as a text file, such as: cloudflare-ipv4.txt, cloudflare-ipv6.txt

  • cloudflare-ipv4.txt

  • cloudflare-ipv6.txt


Find the Fastest IP Address to Access Cloudflare on Your Network

The community provides a tool to find the fastest Cloudflare IP address: CloudflareSpeedTest. We can use this tool to find the fastest IP address.

The corresponding command is as follows:

./CloudflareSpeedTest -url

After successful execution, you will get the fastest IP address.
Since the tool randomly uses some IP addresses for testing, you can execute the above command multiple times to ensure that you get the fastest IP address.

Configure SmartDNS acceleration

The principle is to use the ip-alias command to map the entire anycast IP of Cloudflare to the fastest IP address obtained from CloudflareSpeedTest.
Configure SmartDNS as follows:

# Set up Cloudflare IPV4 alias mapping
ip-set -name cloudflare-ipv4 -file /path/to/cloudflare-ipv4.txt
ip-rules ip-set:cloudflare-ipv4 -ip-alias,

# Set up Cloudflare IPV6 alias mapping
ip-set -name cloudflare-ipv6 -file /path/to/cloudflare-ipv6.txt
ip-rules ip-set:cloudflare-ipv6 -ip-alias 2606:4700:17:d8e7:5e98:7d62:6674:c5a7