All Products
Search
Document Center

Web Application Firewall:DescribeDomain

Last Updated:Mar 31, 2026

Queries the configuration of a domain name added to Web Application Firewall (WAF).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesDescribeDomainThe operation to perform. Set the value to DescribeDomain.
DomainStringYeswww.example.comThe domain name to query. To get the domain names added to WAF, call the DescribeDomainNames operation.
InstanceIdStringYeswaf-cn-7pp26f1****The ID of the WAF instance. To get the instance ID, call the DescribeInstanceInfo operation.

All Alibaba Cloud API requests must include common request parameters. For more information, see Common request parameters.

Response elements

ParameterTypeExampleDescription
RequestIdStringD827FCFE-90A7-4330-9326-D33C8B4C7726The request ID.
DomainStructThe domain name configuration.

Domain

ParameterTypeExampleDescription
AccessHeaderModeInteger1The method used to obtain the actual client IP address. Valid values: 0: WAF reads the first value of the X-Forwarded-For (XFF) header. 1: WAF reads the value of a custom header field. Returned only when IsAccessProduct is 1.
AccessHeadersList["X-Client-IP"]The custom header field used to obtain the actual client IP address. Returned only when AccessHeaderMode is 1.
AccessTypeStringwaf-cloud-dnsThe mode used to add the domain name to WAF. Valid values: waf-cloud-dns: CNAME record mode. waf-cloud-native: transparent proxy mode.
ClusterTypeInteger0The type of the WAF protection cluster. Valid values: 0: shared cluster. 1: exclusive cluster. Returned only when AccessType is waf-cloud-dns.
CnameStringkdmqyi3ck7xogegxpiyfpb0fj21mgkxn.****.comThe CNAME assigned by WAF to the domain name. Returned only when AccessType is waf-cloud-dns.
ConnectionTimeInteger5The connection timeout period for WAF clusters. Unit: seconds. Returned only when AccessType is waf-cloud-dns.
Http2PortList[443,8443]The HTTP/2 ports. Returned only when AccessType is waf-cloud-dns and HttpsPort is specified.
HttpPortList[80]The HTTP ports. Returned only when AccessType is waf-cloud-dns.
HttpToUserIpInteger0Specifies whether HTTPS-to-HTTP redirection for back-to-origin requests is enabled. Valid values: 0: disabled. 1: enabled. Returned only when AccessType is waf-cloud-dns and HttpsPort is specified.
HttpsPortList[443,8443]The HTTPS ports. Returned only when AccessType is waf-cloud-dns.
HttpsRedirectInteger0Specifies whether HTTP-to-HTTPS redirection is enabled. Valid values: 0: disabled. 1: enabled. Returned only when AccessType is waf-cloud-dns and HttpsPort is specified.
IpFollowStatusInteger1Specifies whether WAF forwards requests to the origin server using the same IP address type as the request. Valid values: 0: disabled. 1: enabled. Returned only when AccessType is waf-cloud-dns.
IsAccessProductInteger1Specifies whether a Layer 7 proxy is configured in front of WAF. Layer 7 proxies include Anti-DDoS Pro, Anti-DDoS Premium, and Alibaba Cloud CDN. Valid values: 0: no Layer 7 proxy is configured. 1: a Layer 7 proxy is configured.
KeepaliveBooleantrueSpecifies whether persistent connections are enabled. Valid values: true (default). false.
KeepaliveRequestsInteger1000The maximum number of requests per persistent connection. Valid values: 60 to 1000.
KeepaliveTimeoutInteger15The idle timeout period for persistent connections. Unit: seconds. Valid values: 1 to 60. Default value: 15.
LoadBalancingInteger2The load balancing algorithm for forwarding requests to the origin server. Valid values: 0: IP hash. 1: round-robin. 2: least time. Returned only when AccessType is waf-cloud-dns.
ReadTimeInteger120The read connection timeout period for WAF clusters. Unit: seconds. Returned only when AccessType is waf-cloud-dns.
ResourceGroupIdStringrg-acfm2mkrunv****The ID of the resource group to which the WAF instance belongs.
RetryBooleantrueSpecifies whether WAF retries forwarding requests to the origin server after a forwarding failure. Valid values: true (default). false.
SniHostStringwaf.example.comThe custom Server Name Indication (SNI) field value. If empty, the value of the Host header is used. Returned only when SniStatus is 1.
SniStatusInteger1Specifies whether origin SNI is enabled. Origin SNI is the domain name used to establish an HTTPS connection during the TLS handshake when WAF forwards requests to the origin server. Valid values: 0: disabled. 1: enabled. Returned only when AccessType is waf-cloud-dns and HttpsPort is specified.
SourceIpsList["39.XX.XX.197"]The origin server IP addresses. Returned only when AccessType is waf-cloud-dns.
VersionLong40The version number of the domain name configuration.
WriteTimeInteger120The write connection timeout period for WAF clusters. Unit: seconds. Returned only when AccessType is waf-cloud-dns.

CloudNativeInstances (returned only when AccessType is waf-cloud-native)

ParameterTypeExampleDescription
CloudNativeProductNameStringALBThe type of cloud service instance. Valid values: SLB: Classic Load Balancer (CLB) instance, formerly known as Server Load Balancer (SLB). ECS: Elastic Compute Service (ECS) instance. ALB: Application Load Balancer (ALB) instance.
IPAddressListString["39.XX.XX.197"]The public IP addresses of the cloud service instance.
InstanceIdStringalb-s65nua68wdedsp****The ID of the cloud service instance.

ProtocolPortConfigs (within CloudNativeInstances)

ParameterTypeExampleDescription
PortsString[80]The ports.
ProtocolStringhttpThe protocol. Valid values: http. https.
RedirectionTypeNameStringALBThe type of traffic redirection port. Valid values: SLB-L4: Layer 4 listening ports of the CLB instance. SLB-L7: Layer 7 listening ports of the CLB instance. ECS: listening ports of ECS instances. ALB: HTTP and HTTPS listening ports of ALB instances.

LogHeaders (returned only when traffic marking is enabled for the domain name)

ParameterTypeExampleDescription
kStringALIWAF-TAGThe name of the custom header field.
vStringYesThe value of the custom header field.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeDomain
&Domain=www.example.com
&InstanceId=waf-cn-7pp26f1****
&<Common request parameters>

Sample success responses

XML format

<DescribeDomainResponse>
      <RequestId>D827FCFE-90A7-4330-9326-D33C8B4C7726</RequestId>
      <Domain>
            <HttpToUserIp>0</HttpToUserIp>
            <HttpPort>80</HttpPort>
            <IsAccessProduct>1</IsAccessProduct>
            <AccessHeaderMode>1</AccessHeaderMode>
            <ResourceGroupId>rg-acfm2mkrunv****</ResourceGroupId>
            <AccessHeaders>X-Client-IP</AccessHeaders>
            <ReadTime>120</ReadTime>
            <SourceIps>39.XX.XX.197</SourceIps>
            <IpFollowStatus>1</IpFollowStatus>
            <ClusterType>0</ClusterType>
            <LoadBalancing>2</LoadBalancing>
            <Cname>kdmqyi3ck7xogegxpiyfpb0fj21mgkxn.****.com</Cname>
            <LogHeaders>
                  <v>Yes</v>
                  <k>ALIWAF-TAG</k>
            </LogHeaders>
            <WriteTime>120</WriteTime>
            <Http2Port>443</Http2Port>
            <Http2Port>8443</Http2Port>
            <Version>40</Version>
            <HttpsRedirect>0</HttpsRedirect>
            <ConnectionTime>5</ConnectionTime>
            <AccessType>waf-cloud-dns</AccessType>
            <HttpsPort>443</HttpsPort>
            <HttpsPort>8443</HttpsPort>
            <Keepalive>true</Keepalive>
            <KeepaliveTimeout>15</KeepaliveTimeout>
            <Retry>true</Retry>
            <KeepaliveRequests>1000</KeepaliveRequests>
      </Domain>
</DescribeDomainResponse>

JSON format

{
  "RequestId": "D827FCFE-90A7-4330-9326-D33C8B4C7726",
  "Domain": {
    "HttpToUserIp": 0,
    "HttpPort": [
      80
    ],
    "IsAccessProduct": 1,
    "AccessHeaderMode": 1,
    "ResourceGroupId": "rg-acfm2mkrunv****",
    "AccessHeaders": [
      "X-Client-IP"
    ],
    "ReadTime": 120,
    "SourceIps": [
      "39.XX.XX.197"
    ],
    "IpFollowStatus": 1,
    "ClusterType": 0,
    "LoadBalancing": 2,
    "Cname": "kdmqyi3ck7xogegxpiyfpb0fj21mgkxn.****.com",
    "LogHeaders": [
      {
        "v": "Yes",
        "k": "ALIWAF-TAG"
      }
    ],
    "WriteTime": 120,
    "Http2Port": [
      443,
      8443
    ],
    "Version": 40,
    "HttpsRedirect": 0,
    "ConnectionTime": 5,
    "AccessType": "waf-cloud-dns",
    "HttpsPort": [
      443,
      8443
    ],
    "Keepalive": true,
    "KeepaliveTimeout": 15,
    "SniStatus": 0,
    "Retry": true,
    "KeepaliveRequests": 1000
  }
}

Error codes

For a list of error codes, see Service error codes.