All Products
Search
Document Center

Object Storage Service:delete-cname

Last Updated:Mar 20, 2026

Removes a custom domain name (CNAME record) from a bucket.

Permissions

By default, an Alibaba Cloud account can remove CNAME records from its buckets. If you use a Resource Access Management (RAM) user or Security Token Service (STS) to run this command, the principal must have the oss:DeleteCname permission. For more information, see Grant custom access policies to a RAM user.

Syntax

ossutil api delete-cname --bucket <bucket-name> --cname-configuration <config> [flags]
ParameterTypeDescription
--bucketstringThe bucket name.
--cname-configurationstringThe CNAME configuration. Accepts XML or JSON syntax. Use the file:// prefix to load from a file.
This command maps to the DeleteCname API operation. For global command-line options, see Supported global command-line options.

--cname-configuration syntax

XML:

<BucketCnameConfiguration>
  <Cname>
    <Domain>string</Domain>
  </Cname>
</BucketCnameConfiguration>

JSON:

{
  "Cname": {
    "Domain": "string"
  }
}

Examples

The following examples remove the custom domain example.com from examplebucket.

Inline JSON (simplest):

ossutil api delete-cname --bucket examplebucket --cname-configuration "{\"Cname\":{\"Domain\":\"example.com\"}}"

XML configuration file (cname-configuration.xml):

<?xml version="1.0" encoding="UTF-8"?>
<BucketCnameConfiguration>
  <Cname>
    <Domain>example.com</Domain>
  </Cname>
</BucketCnameConfiguration>
ossutil api delete-cname --bucket examplebucket --cname-configuration file://cname-configuration.xml

JSON configuration file (cname-configuration.json):

{
  "Cname": {
    "Domain": "example.com"
  }
}
ossutil api delete-cname --bucket examplebucket --cname-configuration file://cname-configuration.json