Connecting a Domain Name to WAF¶
This section describes how to connect a domain name to WAF so that website traffic passes through WAF.
To ensure that WAF works properly, you are advised to test WAF by following the instructions in Testing WAF before performing this operation.
How WAF Works¶
No proxy used
DNS resolves your domain name to the origin server IP address before the site is moved to WAF. DNS resolves your domain name to the CNAME of WAF after the site is connected to WAF. WAF then filters out illegitimate traffic and only routes legitimate traffic back to the origin server.
A proxy (such as AAD) used
DNS resolves the domain name to the AAD IP address before your site is moved to WAF. In this case, the traffic passes through AAD and then AAD routes the traffic back to the origin server. After your site is moved to WAF, change the AAD back-to-source IP address to the access address of WAF and add a subdomain name and TXT record to the DNS records of your DNS provider for WAF to take effect. In this way, AAD forwards the traffic to WAF. WAF then filters out illegitimate traffic and only routes legitimate traffic back to the origin server.
Prerequisites¶
Login credentials have been obtained.
A domain name has been created but not connected to WAF.
Procedure¶
Log in to the management console.
Click in the upper left corner of the management console and select a region or project.
Choose Security > Web Application Firewall. In the navigation pane on the left, choose Domains. Figure 1 shows an example.
Note
In the upper part of the domain name list, click Quota details to view the domain name quota.
In the Name column, click the target domain name. Its information is displayed.
Without a proxy
In the CNAME row, click to copy the CNAME value.
Go to your DNS provider and configure the CNAME record. For details, contact your DNS provider.
Important
The high availability of our system, which is based on multi-AZ deployments to support both active-active and disaster recovery, relies on the WAF CNAME record. Therefore,
Do not modify the hosts file. Add the CNAME record directly to the DNS records of your DNS provider.
Do not use the A record to replace the CNAME record.
The CNAME binding method of some common DNS providers is listed for your reference. If the following configuration is inconsistent with the actual configuration, rely on information provided by the DNS providers.
Log in to the management console of the DNS provider.
Go to the domain resolution record page.
Set the CNAME resolution record.
Set the record type to CNAME.
Generally, enter the domain name prefix in the host record. For example, if the protected domain name is admin.demo.com, enter admin in the host record.
The record value is the CNAME generated by WAF.
Resolution line: keep the default value TTL.
Click Save.
Important
The preceding resolution methods are provided by third parties. This document does not control or assume responsibility for any third party content, including but not limited to its accuracy, compatibility, reliability, availability, legitimacy, appropriateness, performance, non-infringement, or status update, unless otherwise specified in this document.
Verify that the CNAME has been configured.
In Windows, choose Start > Run. Then enter cmd and press Enter.
Run the following command to query the CNAME. If the configured CNAME is displayed, the configuration is successful.
nslookup www.domain.com
With a proxy
Click in the Access Address, Subdomain Name, and TXT Record rows to copy the required values, respectively.
Change the back-to-source address of the proxy (such as AAD or CDN) to the copied access address. Add a subdomain name and TXT record to the DNS records of your DNS provider. Then, the domain name is connected to WAF and traffic passes through WAF.
Important
The high availability of our system, which is based on multi-AZ deployments to support both active-active and disaster recovery, relies on the WAF CNAME record.
Note
By default, WAF detects the DNS status of each protected domain name hourly. If you have performed domain connection and DNS is Normal, the domain name is connected to WAF.