Help Center/ Object Storage Service/ Tools Guide/ obsutil/ Best Practices/ Using a User-Defined Domain Name to Access a Bucket and Its Objects
Updated on 2026-09-20 GMT+08:00

Using a User-Defined Domain Name to Access a Bucket and Its Objects

obsutil allows you to specify a user-defined domain name using either a configuration file or command parameters.

  • To do so using a configuration file, see Configuring a User-Defined Domain Name in obsutil to Access OBS.
  • To do so using command parameters, add -bucket-cname=example.com to the original command to specify the user-defined domain name bound to the bucket. Common Linux commands are described as follows:

    Function

    Command

    Listing objects in a bucket

    obsutil ls obs://bucket -bucket-cname=example.com

    Uploading objects

    obsutil cp /tmp/test.txt obs://bucket-test/key -bucket-cname=example.com

    Downloading objects

    obsutil cp obs://bucket-test/key /tmp/test.txt -bucket-cname=example.com

    Deleting objects

    obsutil rm obs://bucket-test/key -bucket-cname=example.com