Support for multiple website domain names
Note
This guide describes how to set up support for a website's primary domain name and its subdomainexample.com
and www.example.com
.
To set up an additional domain, e.g., example2.com
, create a bucket with its name.Next, configure hosting for this bucket and specify the parameters for a redirect from it to the primary domain.
To support multiple domain names for your website, e.g., example.com
and www.example.com
:
-
Create a bucket. Give it a domain name, e.g.,
www.example.com
. -
Configure the bucket as hosting.
-
Link a domain name, e.g.,
www.example.com
, to your bucket. -
On the DNS server, add another resource record to link one more domain name, e.g.,
example.com
, to the bucket:Yandex Cloud DNSThird-party DNS serverCreate a resource record in Cloud DNS with the following parameters:
Name Type TTL Value example.com. ANAME 600 www.example.com.website.yandexcloud.net ANAME records allow second-level domains to be used for hosting. Unlike CNAME records, they do not restrict the use of other record types in the same zone.
Updating the resource records may take some time.
CNAME resource record example:
example.com CNAME www.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 has to do with how CNAME records are processed on DNS hosting. For more information, see section 2.4 of RFC 1912
.Updating the resource records may take some time.
If for some reason you cannot or do not want to create an additional resource record, you can do the following:
- Create a VM with a public IP address.
- Link the
example.com
domain to the VM's public IP address. - Set up all required aliases on the DNS server side.
- Install a web server on the VM and configure a redirect to the Object Storage bucket.