All Products
Search
Document Center

Anti-DDoS:Locally validate your forwarding configuration

Last Updated:Aug 29, 2026

Anti-DDoS Proxy forwards packets destined for a port on the Anti-DDoS Proxy IP address to the corresponding port on the origin server. To keep your service stable, validate locally that the forwarding configuration has taken effect before you connect your service to Anti-DDoS Proxy.

Prerequisites

Choose a validation method

The method depends on the configuration you added:

  • Services accessed by a domain name: if the server address in the client is a domain name instead of an IP address, add a website configuration when you connect the service. Then validate the configuration by modifying the local hosts file or by using the CNAME address.

  • Layer 4 services accessed by an IP address: gaming and other Layer 4 services often do not require a domain name and interact directly by IP address. For these, add a port forwarding rule when you connect the service. Then validate the configuration by using the Anti-DDoS Proxy IP address.

Important

Switching your service before the forwarding configuration takes effect might interrupt it.

Modify the local hosts file

Use this method to validate a website configuration that uses a domain name.

  1. Modify the local hosts file so that requests from your computer to the protected site pass through Anti-DDoS Proxy. These steps use Windows as an example.

    1. Locate the hosts file, stored by default in the C:\Windows\System32\drivers\etc\ folder.

    2. Open the hosts file in a text editor.

    3. Add the following content to the last line: Anti-DDoS Proxy IP address Website domain name. For example, if the Anti-DDoS Proxy IP address is 180.173.XX.XX and the domain name is demo.aliyundoc.com, add: 180.173.XX.XX demo.aliyundoc.com.

    4. Save the hosts file.

  2. On your computer, run the ping command for the protected domain name. The resolved address should be the Anti-DDoS Proxy IP address you bound in the hosts file. If the origin server address is still returned, refresh the local DNS cache: on Windows, run the ipconfig /flushdns command in Command Prompt.

  3. After local resolution switches to the Anti-DDoS Proxy IP address, access the service by using the original domain name. If it is accessible, the forwarding configuration has taken effect.

Use the Anti-DDoS Proxy CNAME address to access the server

Use this method when your client supports specifying the server domain name.

Replace the original domain name with the CNAME address assigned by Anti-DDoS Proxy, then test whether the service is accessible.

Note

After you add a website configuration, Anti-DDoS Proxy assigns a CNAME address to the domain name for service integration. You can view it in the website configuration list.

Use the Anti-DDoS Proxy IP address to access the server

Use this method to validate a port forwarding configuration. This example assumes:

  • Anti-DDoS Proxy IP address: 99.99.XX.XX

  • Forwarding port: 1234

  • Origin server IP address: 11.11.XX.XX

  • Origin server service port: 1234

    After you add the port configuration, run the telnet command on your local computer to access port 1234 on the Anti-DDoS Proxy IP address 99.99.XX.XX. If the connection succeeds, the port forwarding configuration has taken effect.

If your client supports specifying the server IP address, you can also enter the Anti-DDoS Proxy IP address to test.