Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Object Storage
    • All guides
      • Setting up hosting
      • Support for your own domain
        • Overview
        • Management console, CLI, and API
        • Terraform
      • Configuring HTTPS
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Bucket logs
  • Release notes
  • FAQ

In this article:

  • Create buckets
  • Set up a static website for your main domain
  • Set up a redirect for an additional domain
  • Check the performance of several domains
  1. Step-by-step guides
  2. Hosting static websites
  3. Support for multiple domain names
  4. Management console, CLI, and API

Support for multiple domain names using the management console, CLI, or API

Written by
Yandex Cloud
Updated at December 3, 2025
  • Create buckets
  • Set up a static website for your main domain
  • Set up a redirect for an additional domain
  • Check the performance of several domains

To create an infrastructure to support multiple website domain names using the Yandex Cloud management console, CLI, or API:

  1. Create buckets.
  2. Set up a static website for your main domain.
  3. Set up a redirect for an additional domain.
  4. Check the performance of several domains.

Create bucketsCreate buckets

Create buckets and name them according to the domain names, e.g., example.com and example2.com.

  1. Create a bucket for the main example.com domain name:

    Management console
    Yandex Cloud CLI
    API
    1. In the management console, select the folder where you want to create a bucket.

    2. Go to Object Storage.

    3. In the top panel, click Create bucket.

    4. On the bucket creation page:

      1. Enter a name for the bucket according to the main domain name of the website, e.g., example.com.

        Note

        Bucket names must match domain names.

      2. Set the maximum bucket size.

      3. Enable For all: Access for any users.

      4. Select the default storage class: Standard.

      5. Click Create bucket to complete the operation.

    If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

    By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

    1. View the description of the CLI command to create a bucket:

      yc storage bucket create --help
      
    2. Create a bucket in the default folder:

      yc storage bucket create --name <bucket_name> \
        --public-read \
        --public-list
      

      Where:

      • --name: Bucket name according to the main domain name of the website, e.g., example.com.

        Note

        Bucket names must match domain names.

      • --public-read: Enables public read access to bucket objects.

      • --public-list: Enables public view access to the list of bucket objects.

      Result:

      name: example.com
      folder_id: b1geoelk7fld********
      anonymous_access_flags:
        read: true
        list: true
      default_storage_class: STANDARD
      versioning: VERSIONING_DISABLED
      created_at: "2025-08-08T09:12:45.743187Z"
      resource_id: e3etgi7l43gs********
      

    To create a bucket, use the create REST API method for the Bucket resource, the BucketService/Create gRPC API call, or the create S3 API method.

  2. Create a bucket for the additional example2.com domain name by repeating the steps above.

Set up a static website for your main domainSet up a static website for your main domain

Set up a static website for the bucket and link it to your main example.com domain name:

  1. Set up the example.com bucket to host your static website.

    Management console
    Yandex Cloud CLI
    API
    1. In the management console, select a folder.
    2. Go to Object Storage.
    3. Select the bucket you want to configure hosting for.
    4. In the left-hand panel, select Settings.
    5. Select the Website tab.
    6. Under Hosting:
      • In the Home page field, specify the absolute path to the file in the bucket for the website home page, e.g., index.html.

        Warning

        The key of the object containing your website homepage must not include the / character.

      • Optionally, in the Error page field, specify the absolute path to the file in the bucket to show for 4xx errors, e.g., pages/error404.html. By default, Object Storage returns its own page.

    7. Click Save.

    Use the link in Link to check the hosting.

    1. See the description of the CLI command for setting up static website hosting in a bucket:

      yc storage bucket update --help
      
    2. Create a hosting configuration file in JSON format. Here is an example:

      {
        "index": "index.html",
        "error": "error404.html"
      }
      

      Where:

      • index: Absolute path to the website home page file.

        Warning

        The key of the object containing your website homepage must not include the / character.

      • error: Absolute path to the file the user will see in case of 4xx errors.

    3. Run this command:

      yc storage bucket update --name <bucket_name> \
        --website-settings-from-file <path_to_file>
      

      Where:

      • --name: Bucket name.
      • --website-settings-from-file: Path to the hosting configuration file.

      Result:

      name: my-bucket
      folder_id: b1gjs8dck8bv********
      default_storage_class: STANDARD
      versioning: VERSIONING_SUSPENDED
      max_size: "10737418240"
      acl: {}
      created_at: "2022-12-14T08:42:16.273717Z"
      

    To make sure the bucket description now contains the hosting settings, run this command:

    yc storage --name <bucket_name> bucket get --full
    

    Result:

    website_settings:
      index: index.html
      error: error404.html
      redirect_all_requests: {}
    

    To set up hosting for a static website, use the update REST API method for the Bucket resource, the BucketService/Update gRPC API call, or the upload S3 API method.

  2. Link the example.com domain name and the relevant bucket.

    1. On the DNS sever, create a public DNS zone and a resource record which links your domain name to the bucket:

      Yandex Cloud DNS
      Third-party DNS server

      Warning

      Cloud DNS usage is chargeable; for more information, see Cloud DNS pricing policy.

      1. In the management console, select a folder.

      2. Go to Object Storage.

      3. Select the bucket you want to use your own domain for.

      4. In the left-hand panel, select Settings and go to the Website tab.

      5. In Hosting, under Domains in Cloud DNS, click Create record.

        Note

        Under Domains in Cloud DNS in the Hosting section, you can only see those domains that were created directly through this interface. Records created in Cloud DNS will not be shown.

      6. In the window that opens, click Create zone and select the domain zone that matches the bucket name, e.g., example.com. Click Create.

      7. Expand Additional settings.

      8. In the TTL (in seconds) field, specify the resource record time to live or select a value from the list.

      9. Click Create.

      10. Click Save.

      To gain access to public zone domain names, delegate the domain by specifying the ns1.yandexcloud.net and ns2.yandexcloud.net server addresses in your domain registrar account.

      Delegating a domain and updating resource records may take a while.

      You can also use Cloud DNS to create a DNS zone and resource record.

      Example of DNS zone and resource record parameters

      DNS zone parameters:

      • Zone: example.com
      • Type: Public

      Resource record parameters:

      Name Type TTL Value
      example.com. ANAME 600 example.com.website.yandexcloud.net

      ANAME records enable using second-level domains for hosting. Unlike CNAME records, they do not restrict the use of other record types in the same zone.

      Here is an example of DNS zone parameters:

      • Zone: example.com
      • Type: Public

      An example of a CNAME resource record looks like this:

      example.com CNAME example.com.website.yandexcloud.net
      

      To use a CNAME resource record, make sure your domain name belongs to at least a third-level domain. This restriction is due to the way CNAME records are handled on DNS hosting platforms. For more information, see RFC 1912, section 2.4.

      Updating resource records may take a while.

      As a result, the static website will be available at example.com.

  3. Configure HTTPS by linking a Certificate Manager certificate to your bucket or uploading your own.

    Note

    You can use one certificate for both your main and additional domains or multiple certificates for each domain.

    Request redirects from HTTP to HTTPS are enabled automatically once you set up HTTPS access to a bucket. No other settings are required.

As a result, the static website will be available at example.com using HTTPS.

Set up a redirect for an additional domainSet up a redirect for an additional domain

For the bucket with the additional example2.com domain name:

  1. Set up the example2.com bucket to redirect all requests to the main example.com domain and use HTTPS.

    Management console
    Yandex Cloud CLI
    API
    1. In the management console, select a folder.
    2. Go to Object Storage.
    3. Select the bucket you want to redirect all requests for.
    4. In the left-hand panel, select Settings.
    5. Select the Website tab.
    6. Under Redirect, specify:
      • Domain name: Domain name to which all requests will be redirected, e.g., example.com.
      • Protocol: HTTPS.
    7. Click Save.
    1. See the description of the CLI command for setting up redirects for all requests:

      yc storage bucket update --help
      
    2. Create a redirect configuration file in JSON format. Here is an example:

      {
        "redirectAllRequests": {
          "protocol": "PROTOCOL_HTTPS",
          "hostname": "example.com"
        }
      }
      

      Where:

      • protocol: Data transfer protocol.
      • hostname: Domain name of the host to act as the redirect target for all requests to the current bucket.
    3. Run this command:

      yc storage bucket update --name <bucket_name> \
        --website-settings-from-file <path_to_file>
      

      Where:

      • --name: Bucket name.
      • --website-settings-from-file: Path to the redirect configuration file.

      Result:

      name: example2.com
      folder_id: b1gjs8dck8bv********
      default_storage_class: STANDARD
      versioning: VERSIONING_SUSPENDED
      max_size: "10737418240"
      acl: {}
      created_at: "2022-12-14T08:42:16.273717Z"
      

    To set up redirects for all requests to a bucket, use the update REST API method for the Bucket resource, the BucketService/Update gRPC API call, or the upload S3 API method.

  2. Configure HTTPS by linking a Certificate Manager certificate to your bucket or uploading your own.

    Request redirects from HTTP to HTTPS are enabled automatically once you set up HTTPS access to a bucket. No other settings are required.

  3. Link the example2.com domain name and the relevant bucket.

Check the performance of several domainsCheck the performance of several domains

Wait until the TLS certificate is issued and switches to the Issued status. After that, make sure the redirect works: opening the https://example2.com website should take you to https://example.com.

See alsoSee also

  • Support for multiple domain names using Terraform

Was the article helpful?

Previous
Overview
Next
Terraform
© 2025 Direct Cursus Technology L.L.C.