Modify the DNS resolution record of the domain name to resolve the website domain name to the Anti-Bot instance. This completes formal service access.

We recommend that you configure Anti-Bot by using a CNAME record. After the domain name is added to the Anti-Bot console, Anti-Bot allocates a CNAME value to the domain name. Then, you can complete Anti-Bot configuration by adding the CNAME record or changing the record value to the allocated CNAME value.
Note Check and record the CNAME value that Anti-Bot allocates to the website domain name based on Step 1: Add a domain name, for example, xxxxxxxxxxxxx.alicloudwaf.com.

Instructions on CNAME configuration

Anti-Bot typically protects websites through CNAME resolution. A record resolution is also supported.
Note We strongly recommend that you use CNAME resolution. This is because configuring Anti-Bot through CNAME resolution enables the automatic switching of node IP addresses and even switching of direct resolution to the origin server in some extreme situations, such as node and data center failures. This maximizes the stability of service operation and provides high availability and disaster recovery capabilities.

If you do need to use A record resolution (for example, in cases where the @ record conflicts with the MX record), you can retrieve the allocated IP address of the Anti-Bot instance by pinging the CNAME value allocated by Anti-Bot (this IP address is invariable in normal cases). Then, configure Anti-Bot for the website domain name through A record resolution.

Instructions on domain name host records

Here, the domain name abc.com is used as an example.

  • www: is used to exactly match domain names that start with www, such as www.abc.com. On the contrary, abc.com cannot be matched.
  • @: is used to match abc.com with direct access.
  • *: is used to match wildcard domain names, that is, any domain names, such as blog.abc.com, www.abc.com, and abc.com.

Precautions on modifying the DNS resolution record

  • Only one CNAME value can be entered for the same host record. You can change the record value to the CNAME value of Anti-Bot to configure Anti-Bot for the website domain name.

  • Different types of DNS resolution records conflict with each other, and therefore, for the same host record, the CNAME record conflicts with the A record, MX record, TXT record, and other records. For this reason, you must delete existing records before you can add a CNAME record, or change the existing record type to the CNAME type.

    Note We recommend that you delete other resolution records and promptly add a CNAME record. The domain name resolution can be abnormal if the CNAME record is missing for a prolonged period after the A record has been deleted.
  • If you do need to retain the MX record (mail server record), you can resolve the domain name to the IP address of the Anti-Bot instance through A record resolution. After retrieving the allocated IP address of the Anti-Bot instance by pinging the CNAME value (this IP address is invariable in normal cases), change the record value of the A record resolution type of the website domain name to the IP address of the Anti-Bot instance.
    Note If A record resolution is used, Anti-Bot does not support automatic faulty cluster scheduling and fault bypassing.

Procedure

This topic shows how to configure DNS in Alibaba Cloud DNS and PeanutHull. For other DNS service providers, configure DNS based on this topic.

Configuration example in Alibaba Cloud DNS
Note If you use Alibaba Cloud DNS for domain name resolution and have set and enabled the A record for the domain name before performing Step 1: Add a domain name (the domain name is located in Mainland China and has gone through ICP Filing), you can add a website in one click and automatically update the resolution record when adding website configuration. The following procedure is applicable in the event that your domain name has been added to the Anti-Bot domain name list but DNS resolution is abnormal.
Perform the following steps to modify the CNAME record in Alibaba Cloud DNS, to configure Anti-Bot.
  1. Log on to the Alibaba Cloud DNS console.
  2. Select the target domain name and click Configure in the Actions column.
  3. Select the target host record and click Edit in the Actions column.
    Note You can also delete the existing A record and click Add Record to add a new CNAME record. Add a CNAME record as soon as possible after the existing resolution record is deleted. Otherwise, website domain name resolution may fail.
  4. Change the record type to CNAME, and change the record value to the CNAME value allocated by Anti-Bot.
    Note We recommend that you set TTL to 600 seconds (namely, 10 minutes) for general cases. The greater the TTL value, the slower the DNS record synchronization and update.
Configuration example in PeanutHull
Some DNS service providers (such as PeanutHull) may not support directly modifying the types and host records of existing resolution records. If this is the case, you must delete the existing A record before you can add a CNAME record.
Note Add a CNAME record as soon as possible after the existing resolution record is deleted. Otherwise, website domain name resolution may fail.

Verify DNS configuration

After the DNS resolution workload of the website domain name is switched to Anti-Bot, your website domain name is protected by Anti-Bot. After configuring the resolution record, you can verify whether DNS resolution is effective by pinging the website domain name or using a tool such as 17ce.
Note It takes some time for the DNS resolution record to take effect. If the domain name remains inaccessible during the local test, you can retest the domain name 10 minutes later.