Configuring a Public Zone for a Domain Name Used by Website Servers
Scenarios
After you register a domain name and set up a website, you can configure record sets to point the domain name to the IP address of the web server where the website is deployed so that visitors can use the domain name to access your website over the Internet.
For example, you have already built a website on a web server with an IPv4 EIP bound. To allow end users to access your website using domain name example.com and its subdomain www.example.com, do as follows:
- Add an A record set that maps domain name example.com to the EIP.
- Add an A record set that maps subdomain www.example.com to the EIP.
You can also quickly add record sets to map a domain name to your website.
Configuring DNS records for a website is irrelevant to the registrar of the domain name, and the account and location of the web server. You only need to obtain the domain name and the EIP of the web server.
Prerequisites
- A domain name has been registered and its real-name authentication has been reviewed.
- You have deployed a web server and obtained its IP address.
- You have already had your domain name and IP address licensed if your web server is deployed on the Chinese mainland.
- If your web server is purchased from Huawei Cloud, you have obtained the license from Huawei Cloud. For details, see "Setting Up a Web Server" and "What Is Filling".
- If your web server is from another cloud provider, you have obtained the license from that cloud provider.
Process
Figure 1 shows the process for configuring DNS records for the domain name used for accessing your website.
Step 1. Create a Public Zone
After you register a domain name with Huawei Cloud, a public zone will be automatically created. You can view the domain name in the public zone list.
If your domain name is registered with a third-party registrar, create a public zone and add record sets to it on the DNS console.
- Go to the Public Zones page.
- In the upper right corner of the page, click Create Public Zone.
- If the domain name is registered with Huawei Cloud, a public zone is automatically created on the DNS console, and you just need to add record sets to it. If no public zone is created, you need to create one.
- If "This public zone has been created by another account. You need to retrieve the public zone first." is displayed when you are creating a public zone, you can retrieve the public zone by referring to Regaining a Public Zone.
- Set Domain Name to example.com.
Configure other parameters by referring to Creating a Public Zone.
- Click OK.
You can view the created public zone on the Public Zones page.
If a message is displayed indicating that the public zone has already been created by another user, see Regaining a Domain Name.
You can click the domain name to view SOA and NS record sets automatically generated for the zone.
- The SOA record set includes administrative information about your zone, as defined by the Domain Name System (DNS).
- The NS record set defines the authoritative DNS servers for the domain name.
You can modify the NS record set based on the region of the domain name. For more information about the DNS servers, see What Are Huawei Cloud DNS Servers?
Step 2. Add an A Record Set for the Domain Name
Add an A record set to the created public zone to allow access to your website using example.com.
- On the Public Zones page, click the domain name (example.com) of the public zone you created.
The Record Sets tab is displayed.
- In the upper right corner of the page, click Add Record Set.
- Configure the parameters as follows:
- Name: Leave this parameter blank. This is a record set for the domain name, which is example.com.
- Type: Retain the default setting A – Map domains to IPv4 addresses.
- Value: Enter the EIP of your web server.
Configure other parameters by referring to Adding an A Record Set.
- Click OK.
The added record set is in the Normal state.
Step 3. Add an A Record Set for the Subdomain
Add another record set to allow access to your website using www.example.com.
- On the Public Zones page, click the domain name (example.com) of the public zone you created.
The Record Sets tab is displayed.
- In the upper right corner of the page, click Add Record Set.
- Configure the parameters as follows:
- Name: Set it to www, which means that this is a record set for the www.example.com subdomain.
- Type: Retain the default setting A – Map domains to IPv4 addresses.
- Value: Enter the EIP of your web server.
Configure other parameters by referring to Adding an A Record Set.
- Click OK.
The added record set is in the Normal state.
(Optional) Step 4. Change DNS Server Addresses of the Domain Name
For domain names registered with Huawei Cloud, you can skip this step, because Huawei Cloud DNS server addresses are used by default.
For domain names registered with third-party registrars, perform the following steps to change the DNS server addresses to the Huawei Cloud DNS server addresses.
The DNS service provides authoritative DNS servers for domain resolution.
After you create a public zone, an NS record set is generated, which specifies the DNS servers provided by the DNS service.
If DNS server addresses of the public domain name are different from those in the NS record set, the DNS service will not be able to resolve the domain name. You must change the DNS server addresses of the domain name on the registrar's website.
Generally, the changes to DNS server addresses take effect within 48 hours, but the time may vary depending on the domain name registrar's cache duration.
Query the DNS server addresses provided by the DNS service.
- Go to the Public Zones page.
- Click the name of the public zone you created.
Locate the NS record set. The DNS server addresses provided by the DNS service are displayed under Value.
Figure 2 NS record set
Change the DNS servers.
Log in to the domain name registrar's website and change the DNS server addresses to those provided by the DNS service. Refer to the domain name registrar's documentation for detailed operations.
Checking Whether the Record Sets Have Taken Effect
For details, see How Do I Check Whether Record Sets Have Taken Effect?
Follow-up Operations
If you want your website to be accessed over HTTPS, purchase an SSL certificate from Cloud Certificate Manager (CCM) and deploy it for your website.
Last Article: Public Zone Configuration Examples
Next Article: Configuring a Public Zone for a Domain Name Used by Email Servers

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.