Help Center/ Web Application Firewall/ User Guide (Paris) / Best Practices/ WAF Cloud Mode Access Configuration/ Connecting a Domain Name to WAF for Websites with no Proxy Used
Updated on 2024-03-14 GMT+08:00

Connecting a Domain Name to WAF for Websites with no Proxy Used

If your website is not added to WAF, DNS resolves your domain name to the IP address of the origin server. If your website is added to WAF, DNS resolves your domain name to the CNAME of WAF. In this way, the traffic passes through WAF. WAF inspects every traffic coming from the client and filters out malicious traffic. This section describes how to change DNS settings for WAF to take effect.

Schematic Diagram

Figure 1 No proxy used

Prerequisites

  • Website domain names are available.
  • The account to update the DNS configuration is available.
  • (Optional) You have whitelisted WAF back-to-source IP addresses. If other security software is used on the origin server, whitelist the WAF back-to-source IP addresses to prevent normal traffic from being blocked. For details, see Configuring an Access Control Policy on an ECS or ELB to Protect Origin Servers.
  • (Optional) You have tested WAF before changing DNS settings. This can prevent service interruption due to incorrect configurations. For details, see Testing WAF.

Scenario

  • If the Type of the domain name host record added on DNS is CNAME - Map one domain to another, complete the configuration based on the instructions in CNAME Access.

CNAME Access

If the Type of the domain name host record added on DNS is CNAME - Map one domain to another, add the domain name to WAF by following the steps below.

The following describes how to configure CNAME records on some common DNS platforms. The following configuration is for reference only.

  1. Obtain the CNAME record.

    1. Click in the upper left corner of the management console and select a region or project.
    2. Click in the upper left corner and choose Web Application Firewall (Dedicated) under Security.
    3. In the navigation pane on the left, choose Website Settings.
    4. In the Domain Name column, click the website domain name to go to the basic information page.
    5. In the CNAME row, click to copy the CNAME value.

  2. Change the DNS settings.

    1. Log in to the management console of the DNS provider.
    2. Go to the domain resolution record page.
    3. In the displayed Modify Record Set dialog box, change the record.
      • 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 copied CNAME value 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 another record, such as the A record, MX record, or 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.

  3. (Optional) Ping the IP address of your domain name to check whether the new DNS settings take effect.

    It takes some time for the new DNS settings to take effect. If ping fails, wait for 5 minutes and ping again.