Updated on 2025-08-20 GMT+08:00

Configuring a Public Zone for an Email Domain

Scenarios

You can configure record sets for your email domain.

For example, if you want access to a mailbox from a web browser using mail.example.com or from an email client over SMTP, IMAP, or POP, add 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 access the mailbox from a web browser or from an email client (such as Outlook or Foxmail) over SMTP, IMAP, or POP using mail.example.com.
  • A TXT record set containing SPF information for example.com to prevent spam

You only need to obtain the domain name of the email server. You do not need the account and location of the email server.

Procedure

Step

Description

Preparations

Before using Huawei Cloud DNS to resolve email domains, you need to sign up for a HUAWEI ID and enable Huawei Cloud services, set up email servers, register a domain name, and apply for an ICP license.

Step 1: Create a Public Zone

Before configuring record sets for a domain name, add the domain name to the DNS console.

Step 2: Ensure that Huawei Cloud DNS Server Addresses Are Used

When configuring record sets for a domain name, use the DNS server addresses provided by Huawei Cloud.

Step 3 Add an MX Record Set

Add an MX record set to map domain name example.com to the email server address.

Step 4: Add CNAME Record Sets

Add four CNAME record sets for example.com so that end users can access the mailbox from a web browser or from an email client (such as Outlook or Foxmail) over SMTP, IMAP, or POP using mail.example.com.

Step 5: Add a TXT Record Set

Add a TXT record set for the domain name to prevent spam.

Step 6: Check Whether the Record Sets Are Active

Verify that the record sets are active.

Preparations

  1. Sign up for a HUAWEI ID.

    For details, see Sign up for a HUAWEI ID and enable Huawei Cloud services.

  1. Ensure that you have deployed an email server, obtained its public IP address, and registered a domain name.
  2. Ensure that you have obtained the licenses of domain names and IP addresses of web servers in the Chinese mainland.
    • If the server is deployed on Huawei Cloud, you need to apply for an ICP license from the ICP filing center of Huawei Cloud.

      For details, see What Is an ICP Filing?.

    • If your email server is from another cloud provider, you have obtained the license from that cloud provider.
  3. Plan the data required for configuring the record sets based on Table 1.
    Table 1 Email domain record sets

    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.

Step 1: Create a Public Zone

    1. Go to the Public Zones page.
    2. In the upper right corner of the page, click Create Public Zone to host the domain name to the DNS service.

      If "This public zone has been created by another account. You need to reclaim the public zone first." is displayed when you are creating a public zone, you can reclaim the public zone. For details, see Reclaiming a Public Zone.

      Table 2 Parameters for creating a public zone

      Parameter

      Description

      Example

      Domain Name

      Domain name purchased from a domain name registrar.

      Subdomains can be added.

      exampleowner.com

      Enterprise Project

      The enterprise project by which public zones are centrally managed. Select an existing enterprise project for the public zone.

      This parameter is available and mandatory only when Account Type is set to Enterprise Account.

      default

      Tag

      A tag that will be added to classify and identify the public zone.

      example_key1

      example_value1

      Description

      Supplementary information about the zone.

      The description can contain a maximum of 255 characters.

      This is a zone example.

Step 2: Ensure that Huawei Cloud DNS Server Addresses Are Used

In the public zone list, locate the public zone and view the DNS server addresses in the DNS Servers column.

  • If one or more Huawei Cloud DNS server addresses are used, go to Step 3 Add an MX Record Set.
  • If the DNS server addresses are not the Huawei Cloud DNS server addresses, change the DNS server for the public zone by referring to Changing DNS Servers for a Public Domain Name.

    After the DNS server addresses are changed, the changes are synchronized to the DNS Servers column in the public zone list.

    Generally, the new DNS server addresses are quickly synchronized to the top-level domain servers and take effect. However, domain name registrars usually set the TTL value in the NS record set to 48 hours. In some regions, the local DNS server may cache the NS record of the domain name, and it may take a maximum of 48 hours for the DNS server address change to take effect.

Step 3 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.

  1. On the Public Zones page, locate the public zone you created and click the domain name (example.com).
  2. In the upper right corner of the page, click Add Record Set.
  3. Configure the parameters as follows:
    • Type: Select MX - Map domains to email servers.
    • 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.

    • 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 details, see Record Set Types and Configuration Rules.

  4. Click OK.

    The added record set is in the Normal state.

Step 4: Add CNAME Record Sets

To allow access to mailbox from a web browser using mail.example.com or from an email client (such as Outlook or Foxmail) over SMTP, IMAP, and POP, you need to add CNAME record sets for example.com.

  • The email service provider determines whether to allow end users to log in to the mailbox from a web browser.
  • SMTP, IMAP, and POP are email transfer protocols and can be enabled or disabled in email server settings. Email transfer protocols supported by an email server are determined by its settings.

Add four CNAME record sets based on Table 1.

  1. On the Public Zones page, locate the public zone you created and click the domain name (example.com).
  2. In the upper right corner of the page, click Add Record Set.
  3. Configure the parameters as follows:
    • Type: Select CNAME - Map one domain to another.
    • Name: Set the value to mail, which means that this is a record set for mail.example.com, a subdomain of the example.com domain name.
    • Value: Enter mailserver.com.

    Retain the default settings for other parameters. For details, see Record Set Types and Configuration Rules.

    Figure 1 Adding a CNAME record set

    Figure 1 shows the first CNAME record set. You can check names and values for other record sets in Table 1.

  4. Click OK.

    The added record set is in the Normal state.

  5. Repeat 1 through 4 to add the other three record sets.

    For details, see Table 1.

Step 5: 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.

  1. On the Public Zones page, locate the public zone you created and click the domain name (example.com).
  2. In the upper right corner of the page, click Add Record Set.
  3. Configure the parameters as follows:
    • Type: Select TXT - Specify text records.
    • 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.

    • 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 details, see Record Set Types and Configuration Rules.

  4. Click OK.

    The added record set is in the Normal state.

Step 6: Check Whether the Record Sets Are Active

  1. Locate the target public zone and click Check Domain Name in the Operation column.

  2. Click Start Check.

  3. View the check result and rectify the fault using the provided solution.

    You can also click View Details to view detailed information.

  1. On your local host, click the search icon and enter cmd to open the CLI.
  2. Run the command to check whether the record sets are taking effect.
    • Verify the configured MX record set which specifies the email server address.
      1. On your local host, click the search icon and enter cmd to open the CLI.
      2. Check whether the record sets are in effect.

        nslookup -qt=mx Domain name

        Example: nslookup -qt=mx example.com

        If the displayed mailbox address is the same as that configured in the record set, the record set has taken effect.

    • Verify the configured CNAME record set: nslookup -qt=cname Domain name

      Example: nslookup -qt=cname example.com

    • Verify the configured TXT record set: nslookup -qt=txt Domain name

      Example: nslookup -qt=txt example.com