Configuring a Public Zone for a Domain Name Used by Email Servers
Scenarios
You can use DNS to configure email routing for your email servers.
For example, if you want to access an email server with mail.example.com and use the domain name as the server address of SMTP, IMAP, or POP email clients, configure the following record sets:
- An MX record set to map domain name example.com to the email server address
- Four CNAME record sets for example.com so that end users can log in to the mailbox via mail.example.com and use mail.example.com as the SMTP, IMAP, and POP email server addresses on their email clients such as Outlook and Foxmail
- A TXT record set containing SPF information for example.com to prevent spam
For more examples, see What Are Common Record Sets for Email Routing? You can also add record sets for email domains of the following common mailboxes:
- Huawei Cloud Enterprise Mailbox
- Alibaba Cloud Enterprise Mailbox
- Free NetEase Mailbox
- NetEase Enterprise Mailbox
- Tencent Enterprise Mailbox
- You only need to obtain the domain name of the email server. You do not need the account and location of the email server.
- Domain names that are not licensed can be resolved.
- This operation applies to the following scenarios:
- You have registered a domain name with Huawei Cloud and deployed the email server on Huawei Cloud using the same account.
- You have registered a domain name with a third-party registrar and deployed the email server on Huawei Cloud.
- You have registered a domain name with a third-party registrar and deployed the email server on the same cloud as the domain name.
- You have registered a domain name with a third-party registrar and deployed the mail server on a cloud that is not Huawei Cloud.
Prerequisites
- You have registered the domain name (example.com is used as an example).
- You have completed real-name authentication if your domain name is registered in the Chinese mainland.
- You have purchased an email server and obtained its domain name.
- You have already had your domain name and IP address licensed if your email server is deployed on the Chinese mainland.
- If the email server is purchased from Huawei Cloud, you have obtained the license from Huawei Cloud. For details, see "What Is Filing?"
- If your email server is from another cloud provider, you have obtained the license from that cloud provider.
- You have planned the data required for configuring the mailbox resolution records based on Table 1.
Table 1 Record set types for email domains Record Set Type
Name
Value
Description
MX
-
5 mx01.mailserver.com
10 mx02.mailserver.com
Email server address, which is obtained from the email service provider
TXT
-
"v=spf1 include:spf.mailserver.com -all"
SPF records used to prevent spam
CNAME
mail
mailserver.com
Use mail.example.com to log in to the mailbox.
CNAME
smtp
smtp.mailserver.com
Use smtp.example.com as the alias of smtp.mailserver.com.
CNAME
imap
imap.mailserver.com
Use imap.example.com as the alias of imap.mailserver.com.
CNAME
pop
pop.mailserver.com
Use pop.example.com as the alias of pop.mailserver.com.
If a message is displayed, indicating that the record set conflicts with an existing one, handle the issue by following the instructions provided in Why Is a Message Indicating Conflict with an Existing Record Set Displayed When I Add a Record Set?
Process
Figure 1 shows the process for configuring a domain name for your email server.
Step 1. Create a Public Zone
To configure domain names for your email server, create public zone example.com on the DNS console. If you have already registered the domain name with Huawei Cloud, the zone is automatically created, and you can skip this step.
- 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 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.
Click the domain name to query detailed zone information. Record sets of the SOA type and NS type have been created in the zone.
- The SOA record set defines the DNS server that is the authoritative information source for a particular domain name.
- 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 DNS servers, see What Are the DNS Servers Provided by the Huawei Cloud DNS Service?
Step 2. Add an MX Record Set
An MX record set specifies the email server address mapped to the domain name you have registered. The record set value is the email server domain name provided by the email service provider.
- 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.
The Name field cannot be set to an at sign (@). Just leave the field blank.
- Type: Set it to MX.
- Value: Set the record value to the email server address in the format of [Priority][Mail server address].
- priority: priority for an email server to receive emails. A smaller value indicates a higher priority.
- mail server host name: domain name provided by the email service provider
Example:
5 mx01.mailserver.com
10 mx01.mailserver.com
Retain the default settings for other parameters. For detailed descriptions of the parameters, see Adding an MX Record Set.
- Name: Leave this parameter blank. This is a record set for the domain name, which is example.com.
- Click OK.
The added record set is in the Normal state.
Step 3. Add CNAME Record Sets
To log in to Webmail using domain name mail.example.com or use it as SMTP, IMAP, and POP email server addresses on the email clients (such as Outlook and Foxmail), add CNAME record sets for example.com.
- The email service provider determines whether to allow end users to log in to the mailbox through Webmail.
- SMTP, IMAP, and POP are email transfer protocols and can be enabled or disabled in email server settings. Mail transfer protocols supported by an email server are determined by its settings.
Add four CNAME record sets based on Table 1.
- 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 the value to mail, which means that a subdomain mail.example.com of the example.com domain name will be resolved.
- Type: Set it to CNAME.
- Value: Enter mailserver.com.
Retain the default settings for other parameters. For detailed descriptions of the parameters, see Adding a CNAME Record Set.
- Click OK.
The added record set is in the Normal state.
- Repeat 1 through 4 to add the other three record sets.
For details, see Table 1.
Step 4. Add a TXT Record Set
Add a TXT record set for the domain name to prevent spam.
SPF provides a mechanism to prevent spam. It allows you to list all IP addresses used by a domain name to send emails on the Internet in a TXT record set.
You can add a TXT record set in the SPF format to improve the credibility of the domain name and prevent spam.
- 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.
The Name field cannot be set to an at sign (@). Just leave the field blank.
- Type: Set it to TXT.
- Value: Enter the value in SPF format, for example v=spf1 include:spf.mailserver.com -all.
In the example, spf1 is the SPT version. All emails sent with domain name example.com from IP addresses specified by spf.mailserver.com will not be considered as spam.
Retain the default settings for other parameters. For detailed descriptions of the parameters, see Adding a TXT Record Set.
- Name: Leave this parameter blank. This is a record set for the domain name, which is example.com.
- Click OK.
The added record set is in the Normal state.
Step 5. Change DNS Server Addresses of the Domain Name
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.
- Log in to the management console.
- Hover the cursor over
in the upper left corner. In the service list, choose Networking > Domain Name Service. The DNS console is displayed.
- In the navigation pane on the left, choose Public Zones.
The Public Zones page is displayed.
- 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.
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.
Last Article: Configuring a Public Zone for a Domain Name Used by Website Servers
Next Article: Batch Adding Domain Names

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