Queries all CNAME records that are mapped to a bucket.
Request syntax
GET /?cname HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Type: application/xml
Content-Length: 186
Date: Thu, 17 Apr 2025 15:39:12 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,AdditionalHeaders=content-length,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e
Request headers
A ListCname request uses only common request headers. For more information, see Common request headers.
Response headers
The response uses only common response headers. For more information, see Common response headers.
Response elements
|
Element |
Type |
Example |
Description |
|
ListCnameResult |
Container |
N/A |
The container for all CNAME record information. Parent nodes: none Child nodes: Bucket, Owner, and Cname |
|
Bucket |
String |
examplebucket |
The name of the bucket to which the CNAME records are mapped. Parent nodes: ListCnameResult Child nodes: none |
|
Owner |
String |
testowner |
The name of the bucket owner. Parent nodes: ListCnameResult Child nodes: none |
|
Cname |
Container |
N/A |
The container for CNAME record details. Parent nodes: ListCnameResult Child nodes: Domain, LastModified, Status, and Certificate |
|
Domain |
String |
example.com |
The custom domain name. Parent nodes: Cname Child nodes: none |
|
LastModified |
String |
2021-09-15T02:35:07.000Z |
The time when the custom domain name was mapped. Parent nodes: Cname Child nodes: none |
|
Status |
String |
Enabled |
The status of the domain name. Valid values:
Parent nodes: Cname Child nodes: none |
|
Certificate |
Container |
N/A |
The container for certificate information. Parent nodes: Cname Child nodes: Type, CertId, Status, CreationDate, Fingerprint, ValidStartDate, and ValidEndDate |
|
Type |
String |
CAS |
The source of the certificate. Valid values:
Parent nodes: Certificate Child nodes: none |
|
CertId |
String |
493****-cn-hangzhou |
The ID of the certificate. Parent nodes: Certificate Child nodes: none |
|
Status |
String |
Enabled |
The status of the certificate. Valid values:
Parent nodes: Certificate Child nodes: none |
|
CreationDate |
String |
Wed, 15 Sep 2021 02:35:06 GMT |
The time when the certificate was bound. Parent nodes: Certificate Child nodes: none |
|
Fingerprint |
String |
DE:01:CF:EC:7C:A7:98:CB:D8:6E:FB:1D:97:EB:A9:64:1D:4E:**:** |
The signature of the certificate. Parent nodes: Certificate Child nodes: none |
|
ValidStartDate |
String |
Wed, 12 Apr 2023 10:14:51 GMT |
The time when the certificate takes effect. Parent nodes: Certificate Child nodes: none |
|
ValidEndDate |
String |
Mon, 4 May 2048 10:14:51 GMT |
The time when the certificate expires. Parent nodes: Certificate Child nodes: none |
Examples
-
Sample request
GET /?cname HTTP/1.1 Host: oss-example.oss-cn-hangzhou.aliyuncs.com Content-Type: application/xml Content-Length: 186 Date: Tues, 11 May 2022 11:39:12 GMT Authorization: OSS qn6q**************:77Dv**************** -
Sample response
content-length: 1855 x-oss-console-auth: success server: AliyunOSS x-oss-server-time: 7 connection: keep-alive x-oss-request-id: 614169F1AE63BD37355CA12B date: Tues, 11 May 2022 11:39:12 GMT content-type: application/xml <?xml version="1.0" encoding="UTF-8"?> <ListCnameResult> <Bucket>targetbucket</Bucket> <Owner>testowner</Owner> <Cname> <Domain>example.com</Domain> <LastModified>2021-09-15T02:35:07.000Z</LastModified> <Status>Enabled</Status> <Certificate> <Type>CAS</Type> <CertId>493****-cn-hangzhou</CertId> <Status>Enabled</Status> <CreationDate>Wed, 15 Sep 2021 02:35:06 GMT</CreationDate> <Fingerprint>DE:01:CF:EC:7C:A7:98:CB:D8:6E:FB:1D:97:EB:A9:64:1D:4E:**:**</Fingerprint> <ValidStartDate>Wed, 12 Apr 2023 10:14:51 GMT</ValidStartDate> <ValidEndDate>Mon, 4 May 2048 10:14:51 GMT</ValidEndDate> </Certificate> </Cname> <Cname> <Domain>example.org</Domain> <LastModified>2021-09-15T02:34:58.000Z</LastModified> <Status>Enabled</Status> </Cname> <Cname> <Domain>example.edu</Domain> <LastModified>2021-09-15T02:50:34.000Z</LastModified> <Status>Enabled</Status> </Cname> </ListCnameResult>
OSS SDKs
You can call ListCname by using OSS SDKs for the following programming languages:
ossutil
For the ossutil command that corresponds to ListCname, see list-cname.
Error codes
|
Error code |
HTTP status code |
Description |
|
AccessDenied |
403 |
You do not have permissions to call the ListCname operation. Only the bucket owner and RAM users that are granted the |
|
NoSuchCname |
404 |
No CNAME record is mapped to the bucket. |