Help Center/ Web Application Firewall/ Help Panel/ Tier-2 Help Panel - Website Settings/ Step 4: Change Domain Name Resolution Records
Updated on 2025-04-25 GMT+08:00

Step 4: Change Domain Name Resolution Records

If your website is connected to cloud WAF, you need to change the domain name resolution record so that DNS can resolve your domain name to the WAF CNAME record. In this way, the traffic passes through WAF. WAF then filters out illegitimate traffic and only routes legitimate traffic back to the origin server. For details, see Table 1.

Table 1 Operation guide

Scenario

Parameter Generated

Operation Related to Domain Name Resolution

No proxies used

CNAME

DNS resolves the domain name to the WAF CNAME record.

Proxy used

CNAME, subdomain name, and TXT record

  • Change the back-to-source addresses of origin servers for proxies such as CDN and advanced anti-DDoS to the WAF CNAME record.
  • (Optional) Add a WAF subdomain name and TXT record at your DNS provider.

Before a website is connected to WAF, visitors access the website server through a client (such as a browser).

Constraints

  • The CNAME record must be unique for the same host record. The existing CNAME record must be changed to the WAF CNAME record.
  • Record sets of different types in the same zone may conflict with each other. For example, for the same host record, the CNAME record conflicts with other records such as A record, MX record, and TXT record. If the record type cannot be changed, you can delete the conflicting records and add a CNAME record. Deleting other records and adding a CNAME record should be completed in as short time as possible. If no CNAME record is added after the A record is deleted, domain resolution may fail. For details, see Why Is a Message Indicating Conflict with an Existing Record When I Add a Record Set?
  • To prevent other users from configuring your domain name on WAF before you add it to WAF (this will affect WAF protection for your domain name), add the subdomain name and TXT record on your DNS management platform. WAF will determine which user owns the domain name based on the subdomain name and TXT record.
  • A modified record set takes effect when the cache duration specified by the TTL of the original record set expires. If the carrier sets a longer cache duration, the record set will take effect after this period of time elapses.

Procedure

Configure a CNAME record for the protected domain name on the DNS platform you use. The following uses Huawei Cloud DNS as an example to show how to change a CNAME record. If the following configuration is inconsistent with the actual configuration, rely on information provided by the DNS providers.

  1. Click the target domain name to go to the basic information page. In the CNAME row, click to copy the CNAME record.
  2. Modify the DNS record set.

    1. Access the DNS resolution page.
      Figure 1 DNS page
    2. In the Operation column of the target domain name, click Modify. The Modify Record Set page is displayed.
    3. In the displayed Modify Record Set dialog box, change the record value.
      • Name: Domain name configured in WAF
      • Type: Select CNAME-Map one domain to another.
      • Line: Default
      • TTL (s): The recommended value is 5 min. A larger TTL value will make it slower for synchronization and update of DNS records.
      • Value: Change it to the CNAME record copied from WAF.
      • Keep other settings unchanged.

      About modifying the resolution record:

      • The CNAME record must be unique for the same host record. The existing CNAME record must be changed to the WAF CNAME record.
      • Record sets of different types in the same zone may conflict with each other. For example, for the same host record, the CNAME record conflicts with other records such as A record, MX record, and TXT record. If the record type cannot be changed, you can delete the conflicting records and add a CNAME record. Deleting other records and adding a CNAME record should be completed in as short time as possible. If no CNAME record is added after the A record is deleted, domain resolution may fail.
    4. Click OK.