The hosts file specifies the correspondence between the domain name and IP address. If a domain name has an IP address specified in the hosts file, the system will not resolve its IP address through the domain name system (DNS) when accessing this domain name, but will directly access the specified IP address instead.
Therefore, if your website is deployed with Anti-DDoS Pro or WAF services, you can modify the local hosts file to direct the website to the WAF without changing the online business flow. This allows you to test whether or not the business services work normally after they pass through WAF.
Find the IP address allocated by WAF.
When the domain name is configured, WAF generates a CNAME record for resolution purposes. Use the ping command to get the IP address of the CNAME record, and this IP address is the WAF IP. Use www.abc.com as an example.
Find the allocated CNAME record.
Use the ping command to get the IP address of the CNAME record.
Open the hosts file in Notepad, and point the domain name to the WAF IP address.
Note: The hosts file format is “<IP> <domain name>“. For example, point www.abc.com to xx.xx.xx.xxx.
Save the modified hosts file to the