All Products
Search
Document Center

Web Application Firewall:Modify a DNS record

Last Updated:Mar 31, 2026

After you add a domain to Web Application Firewall (WAF) in CNAME record mode, point the domain's DNS record to the CNAME assigned by WAF. This routes all incoming traffic through WAF before it reaches your origin server.

Warning

WAF supports only CNAME records. Do not add an A record pointing to the WAF virtual IP address (VIP). WAF enables VIP isolation by default and may change the VIP when you enable or disable an exclusive IP address or intelligent load balancing. An A record causes service interruptions when the VIP changes. If node failures or data center failures occur, WAF uses a different IP address or forwards requests to the origin server to ensure service continuity — this is why a CNAME record is required instead of an A record.

This topic applies when your website has no upstream proxies such as Alibaba Cloud CDN, Anti-DDoS Pro, or Anti-DDoS Premium. If you use those services together with WAF, see Use WAF together with CDN or Protect a website service by using Anti-DDoS Pro or Anti-DDoS Premium and WAF.

Prerequisites

Before you begin, make sure that:

Warning

Modifying the DNS record before the forwarding configurations take effect causes service interruptions.

Get the WAF CNAME for your domain

  1. Log on to the WAF console.

  2. In the left-side navigation pane, choose Asset Center > Website Access.

  3. In the domain name list, find your domain and move the pointer over it. Copy the CNAME assigned by WAF.

Update the DNS record

The following steps use Alibaba Cloud DNS. If you use a third-party DNS service provider, follow the same logic in that provider's console.

  1. Log on to the Alibaba Cloud DNS console.

  2. On the Authoritative DNS Resolution page, find your domain and click DNS Settings in the Actions column.

  3. On the DNS Settings page, find the hostname to update and click Modify in the Actions column. Hostname patterns for example.com:

    HostnameMatches
    wwwwww.example.com
    @example.com (root domain)
    *All subdomains, such as blog.example.com
  4. Delete any existing A, MX, or TXT records for the same hostname. CNAME records cannot coexist with A, MX, or TXT records for the same hostname.

    Warning

    Delete all conflicting DNS records before proceeding. Leaving them in place makes the domain inaccessible.

  5. In the Modify DNS Record panel, set Record Type to CNAME and Record Value to the WAF CNAME you copied. Keep all other settings unchanged.

    Note

    Set the time-to-live (TTL) to 10 minutes. A larger TTL value specifies a longer period of time to synchronize and update DNS records.

  6. Click OK and wait for the DNS record to take effect.

Verify the update

Ping your domain or use a DNS lookup tool to confirm the record resolves to the WAF CNAME.

Note

DNS propagation is not immediate. If verification fails, wait 10 minutes and try again.

What's next

  • Protect your origin server — If your origin IP address is exposed, attackers can bypass WAF and target your server directly. Configure an Elastic Compute Service (ECS) security group or Server Load Balancer (SLB) allowlist to block direct access. See Configure protection for an origin server.

  • Retrieve client IP addresses — After traffic flows through WAF, your origin server receives requests from WAF's IP addresses rather than end users. Read the X-Forwarded-For header to get the actual client IP. See Retrieve the originating IP addresses of clients.