Configuring a User-Defined Domain Name
If an acceleration domain name is also needed, to prevent objects in OBS buckets from being directly downloaded upon access, you need to perform other required operations after the custom domain name and the acceleration domain name have been configured. For details, see With CDN Acceleration Enabled, Why Are the Objects in My OBS Bucket Directly Downloaded When I Access Them?
Procedure
- In the navigation pane of OBS Console, choose Object Storage.
- In the bucket list, click the bucket you want to operate to go to the Objects page.
- In the navigation pane, choose Domain Name Mgmt.
Figure 1 Domain name management page
- Click Bind User Domain Name. In the displayed dialog box, enter the domain name to configure, as shown in Figure 2. If you want to choose one of the existing Huawei Cloud domain names from the drop-down list on OBS Console, you must have the Domains:domains:getDetails permission. You can contact the administrator to use IAM to grant you this permission. If you do not have this permission, you can only manually type a domain name.
The suffix of a user-defined domain name can contain 2 to 6 uppercase or lowercase letters.
- Click OK.
- Configure a CNAME record on the DNS, and map the user-defined domain name (for example, example.com) to the domain name of the bucket.
The CNAME configuration varies depending on DNS providers.
If your DNS service is provided by Huawei Cloud, perform the following steps to configure a CNAME record:- Log in to the Huawei Cloud console. On the homepage, choose Networking > Domain Name Service. The DNS console is displayed.
- In the navigation pane, choose Public Zones. The domain name list page is displayed.
- Click the domain name which you want to add a record set to.
- Choose the Record Sets tab and click Add Record Set.
- Configure the parameters based on Table 1. Retain the default values for those not listed in the table below.
Table 1 Parameters for adding a record set Parameter
Description
Example Value
Name
Prefix of the domain name
www
Type
Type of the record set, which should be a CNAME-Canonical name here.
CNAME – Map one domain to another
Line
Resolution line. The DNS server will return the IP address of the specified line, depending on where the visitor comes from.
You must add a Default line to ensure that the website is accessible to anyone.
Default
TTL (s)
Cache duration of the record set, in seconds
The default interval is 5 min (300 seconds).
Value
Domain name to be pointed to
- If CDN acceleration is not used, set this parameter to the bucket domain name.
- If CDN acceleration is used, set this parameter to the CNAME record allocated by CDN.
- Click OK.
- Check whether the CNAME configuration takes effect.
Open the Windows command line interface and run the following command:
nslookup -qt=cname User-defined domain name bound to the bucket
- Without CDN acceleration: If the output is the bucket domain name, the CNAME configuration has taken effect.
- With CDN acceleration: If the output is the CNAME record allocated by CDN, the CNAME configuration has taken effect.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.