Help Center> Domain Name Service> Getting Started> Configuring Record Sets for Email Servers

Configuring Record Sets for Email Servers

Scenarios

This chapter describes how to configure DNS record sets for your email server.

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, you need to configure the following record sets:

  • Add an MX record set to add the domain name for the email server address.
  • Add four CNAME record sets for example.com so that users can log in to the mailbox via mail.exmaple.com and use mail.example.com as the SMTP, IMAP, and POP email server addresses on their email clients such as Outlook and Foxmail.
  • Add a TXT record set containing SPF information for example.com to prevent spam.

For more examples, see Common Mailbox Resolution Records. You can also configure email resolution for the following common mailboxes by quickly adding a record set to the domain name of each mailbox:

  • Cloud Speedy Mail
  • 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.

This section 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 cloud service provider 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 email server on a cloud that is not HUAWEI CLOUD.

Prerequisites

  • You have registered a domain name example.com.
  • If the domain name example.com is registered on the Chinese mainland, you must have completed the real-name authentication.
  • You have purchased an email server and obtained its domain name.
  • If the email server is deployed on the Chinese mainland, you must have its domain name and IP address licensed.
    • If you purchase an email server on HUAWEI CLOUD, you need to obtain an ICP license for it on HUAWEI CLOUD.
    • If you purchase the email server from another cloud service provider, obtain the license from that cloud service provider.
  • You have planned the data required for configuring the mailbox resolution records based on Table 1.
    Table 1 Email resolution records

    Record Set Type

    Record Set 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 domain name 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.

Process

Figure 1 shows the process for configuring a domain name for your email server.

Figure 1 Process for configuring an email server domain name

Step 1. Create a Public Zone

To configure domain names for your email server, you need to create a public zone example.com in the DNS service. If you have already registered the domain name with HUAWEI CLOUD, the zone is automatically created, and you can skip this step.

  1. Log in to the management console.
  2. In the Network category, click Domain Name Service.

    The DNS console is displayed.

  3. In the navigation pane, choose DNS Resolution > Public Zones.

    The Public Zones page is displayed.

  4. Click Create Public Zone.
  5. In the Create Public Zone dialog box, set Name to example.com and set other parameters.

    For detailed descriptions of the parameters, see Creating a Public Zone.

    Figure 2 Creating a public zone
  6. Click OK.

    A public zone example.com is created. You can view its information in the zone list on the Public Zones page.

    Figure 3 Public zone list

    If the system displays a message indicating that the public zone has already been created by another user, see Regaining a Domain Name.

    Click the zone name to view detailed zone information. You can view SOA and NS record sets created by the system.

    • The SOA record set defines the DNS server that is the authoritative information source for a particular domain name.
    • The NS record set defines authoritative DNS servers for a domain name.

      You can modify the NS record set based on the region of the domain name. For more information about DNS server addresses, see What Are HUAWEI CLOUD DNS Servers?

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.

  1. In the zone list on the Public Zones page, click the name of the public zone (example.com) you created.

    The Record Sets page is displayed.

  2. Click Add Record Set.
  3. In the displayed dialog box, enter the following information for the MX record set:
    • Name: Leave this parameter blank. The system automatically considers example.com as the name, and requests are routed to example.com.
    • Type: Set it to MX.
    • Value: Set the record value to the email server address in the format of Priority+Email 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 default settings for other parameters. For detailed descriptions of the parameters, see Adding an MX Record Set.

    Figure 4 Adding an MX record set
  4. Click OK.

    The added record set is displayed in the list. Ensure that the status of the record set is Normal.

Step 3. Add CNAME Record Sets

To log in to Webmail using domain name mail.example.com or use it as the address of the SMTP, IMAP, and POP email server addresses on the email client (such as Outlook and Foxmail), add CNAME record sets for example.com.

  • The email service provider determines whether to allow users to log in to the email through Webmail.
  • SMTP, IMAP, and POP are email transfer protocols and can be enabled or disabled in email server settings.

Add four CNAME record sets based on Table 1.

  1. In the zone list on the Public Zones page, click the name of the public zone (example.com) you created.

    The Record Sets page is displayed.

  2. Click Add Record Set.
  3. In the displayed dialog box, enter the following information for the CNAME record set:
    • Name: Set the value to mail, indicating that the domain name to be resolved is mail.example.com.
    • Type: Set it to CNAME.
    • Value: Enter mailserver.com.

    Retain default settings for other parameters. For detailed descriptions of the parameters, see Adding a CNAME Record Set.

    Figure 5 Add Record Set

    Figure 5 shows the settings of 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 displayed in the list. Ensure that the status of the record set is Normal.

  5. Repeat steps 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.

  1. In the zone list on the Public Zones page, click the name of the public zone (example.com) you created.

    The Record Sets page is displayed.

  2. Click Add Record Set.
  3. In the displayed dialog box, enter the following information for the TXT record set:
    • Name: Leave this parameter blank. The system automatically considers example.com as the name, and requests are routed to example.com.
    • 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 default settings for other parameters. For detailed descriptions of the parameters, see Adding a TXT Record Set.

    Figure 6 Adding a TXT record set
  4. Click OK.

    The added record set is displayed in the list. Ensure that the status of the record set is Normal.

Step 5. Change DNS Servers of the Domain Name

After you create a public zone, an NS record set is generated, which specifies the DNS server addresses provided by the DNS service.

If DNS server addresses of the public domain name are not the same as 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 NDS 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

  1. Log in to the management console.
  2. In the Network category, click Domain Name Service.

    The DNS console is displayed.

  3. In the navigation pane, choose DNS Resolution > Public Zones.

    The Public Zones page is displayed.

  4. In the zone list, 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 7 NS record set

Change the DNS server addresses of a domain name

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 Test Whether a Record Set Is Working?