Alibaba Cloud CDN provides the IP Address Check tool to verify whether a specific IP address belongs to a CDN point of presence (POP). You can also check HTTP response headers to confirm whether requests are served from CDN cache. These methods help you verify that CDN acceleration is active and troubleshoot network issues.
Prerequisites
An accelerated domain name added to Alibaba Cloud CDN
DNS resolution for the domain name pointing to the CNAME address assigned by Alibaba Cloud CDN
curl or an equivalent HTTP client installed on your machine
Step 1: Obtain the IP address to check
Obtain the IP address that clients connect to when they access your accelerated domain name.
Run the following command:
# Replace <your accelerated domain name> with your actual accelerated domain name
curl -vso /dev/null https://<your accelerated domain name> 2>&1 | grep "Connected to"The output shows the IP address that the client connected to. Use this IP address in the next step.
Step 2: Use the IP address check tool
Console (Recommended)
Console (Recommended)
On the IP Address Check page of the Alibaba Cloud CDN console, enter the IP addresses that you want to check, and then click Check.
API
API
Call the BatchDescribeCdnIpInfo operation to check whether multiple IP addresses belong to CDN POPs.
Both IPv4 and IPv6 addresses are supported.
You can check up to 20 IP addresses at a time.
Step 3: Check HTTP response headers for CDN cache status
In addition to using the IP Address Check tool, you can check HTTP response headers to determine whether a request passed through Alibaba Cloud CDN and whether it hit the CDN cache.
Run the following command to view the HTTP response headers for your accelerated domain name:
# Replace <your accelerated domain name> with your actual accelerated domain name
curl -I https://<your accelerated domain name>In the response headers, check the following fields:
X-Cache: Indicates the CDN cache status.
HIT: The request hit the CDN cache. The resource was served directly from the CDN POP without a back-to-origin request.MISS: The request missed the CDN cache. The CDN POP sent a back-to-origin request to retrieve the resource from the origin server.
Via: Indicates the intermediate proxy nodes through which the request was routed. If this field contains a CDN POP identifier such as
cache, the request was processed by a CDN POP.
Example response headers:
HTTP/2 200
x-cache: HIT TCP_MEM_HIT
via: cache21.l2cn3000[146,0], cache10.cn3000[1,0]In this example, the X-Cache value of HIT indicates a cache hit, and the cache identifier in the Via field confirms that the request was routed through a CDN POP.
Result analysis
IP address check tool
The IP address is a CDN POP
The IP address belongs to a CDN edge node (POP). The result displays the region and Internet service provider (ISP) of the POP. You can use this information to verify the location of the CDN POP that the client connected to, which helps you troubleshoot network issues.
The IP address is not a CDN POP
The IP address is not in the Alibaba Cloud CDN node database and cannot be identified as a CDN POP. The following are possible causes:
The IP address is not a POP IP address for your accelerated domain name. See Step 1: Obtain the IP address to check for instructions on how to obtain the correct IP address.
Requests were sent directly to the origin server. If you bypass Alibaba Cloud CDN, the client connects to the origin server instead of a CDN POP. Common bypass scenarios include directly accessing the origin server IP address, not configuring a CNAME record, or forcing DNS resolution through a local hosts file.
Verify the following:
The domain name is correctly added to Alibaba Cloud CDN.
DNS resolution for the domain name points to the CNAME address provided by Alibaba Cloud CDN.
No local hosts file entries or proxy configurations interfere with DNS resolution.
The IP address is a private, loopback, or non-public address. Addresses such as
127.0.0.1,192.168.x.x, and10.x.x.xare not CDN POPs. Make sure that you test from a public network by using a real client.
HTTP response headers
The X-Cache and Via response headers indicate whether CDN acceleration is active:
X-Cache is
HIT— The CDN cache served the request. The resource was returned directly from the CDN POP without a back-to-origin request.X-Cache is
MISS— The CDN POP retrieved the resource from the origin server. The request was not served from cache.Via contains a
cacheidentifier — The request was routed through a CDN POP, confirming that CDN acceleration is active.