All Products
Search
Document Center

Object Storage Service:Delete the CNAME record that is mapped to a bucket

Last Updated:Jun 16, 2026

Deletes a CNAME record mapped to a bucket.

Request syntax

POST /?cname&comp=delete HTTP/1.1
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Content-Type: application/xml
Content-Length: 186
Date: GMT Date
Authorization: SignatureValue

Request headers

RestoreObject uses only common request headers. For more information, see Common request headers.

Request elements

Element

Type

Required

Example

Description

BucketCnameConfiguration

Container

Yes

N/A

The container for the CNAME record.

Parent nodes: none

Child nodes: Cname

Cname

Container

Yes

N/A

The container for CNAME information.

Parent nodes: BucketCnameConfiguration

Child nodes: Domain

Domain

String

Yes

example.com

The custom domain name.

Parent nodes: Cname

Child nodes: none

Response headers

The response contains only common response headers. For more information, see Common response headers.

Examples

  • Sample request

    POST /?cname&comp=delete 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
    
    <BucketCnameConfiguration>
      <Cname>
        <Domain>example.com</Domain>
      </Cname>
    </BucketCnameConfiguration>
  • Sample response

    HTTP/1.1 200 OK
    x-oss-request-id: 5C1B138A109F4E405B2D
    Date: Mon, 26 Jul 2021 13:08:38 GMT
    Content-Length: 118
    Content-Type: application/xml
    Connection: keep-alive
    Server: AliyunOSS

OSS SDKs

The following OSS SDKs support the DeleteCname operation:

ossutil

For the ossutil command that corresponds to DeleteCname, see delete-cname.

Error codes

Error code

HTTP status code

Description

AccessDenied

403

You do not have the required permissions to call the DeleteCname operation. Only the bucket owner and RAM users with the oss:DeleteCname permission can delete CNAME records mapped to the bucket.

NoSuchCname

404

No CNAME record is mapped to the bucket.