All Products
Search
Document Center

Alibaba Cloud DNS:Add a DNS record

Last Updated:Jul 18, 2023

This topic describes how to add a Domain Name System (DNS) record in Alibaba Cloud DNS.

Types of DNS records

Alibaba Cloud DNS supports the following types of DNS records:

  • A record

  • Canonical name (CNAME) record

  • Mail exchanger (MX) record

  • AAAA record

  • Text (TXT) record

  • Explicit or implicit URL forwarding record

  • Name server (NS) record

  • Service (SRV) record

  • Certification Authority Authorization (CAA) record

  • Pointer (PTR) record

Add an A record

Scenario

To map a domain name to an IPv4 address, you can add an A record for the domain name.

Procedure

  1. Log on to the Alibaba Cloud DNS console.

  2. Click Domain Name Resolution in the left-side navigation pane. On the Authoritative Domain Names tab of the page that appears, find the domain name for which you want to add an A record and click DNS Settings in the Actions column.

    image..png
  3. On the DNS Settings page, click Add DNS Record.

    image..png
  4. In the panel that appears, specify the following parameters:

  • Record Type: Select A.

  • Hostname: Enter the prefix of the subdomain or an at sign (@) as required. If you want to create an A record for the subdomain www.xxx.com, enter www. If you want to create an A record for the domain name dns-example.com, enter @.

  • DNS Request Source: Select Default. You must specify this parameter. Otherwise, your domain name may be inaccessible to specific users.

  • Record Value: Enter the IPv4 address to which the domain name is mapped.

  • TTL Period: Enter a time-to-live (TTL) value for the A record. A smaller TTL value indicates that record updates take effect more quickly. The default value of TTL Period is 10 Minutes.

    image..png

Add a CNAME record

Scenario

To map a domain name to another domain name that is mapped to an IP address, you can add a CNAME record. CNAME records apply if you use Alibaba Cloud Content Delivery Network (CDN), Alibaba Mail, and Global Traffic Manager (GTM).

Procedure

  • Record Type: Select CNAME.

  • Hostname: Enter the prefix of the subdomain or an at sign (@) as required. If you want to create a CNAME record for the subdomain www.xxx.com, enter www. If you want to create a CNAME record for the domain name dns-example.com, enter @.

  • DNS Request Source: Select Default. You must specify this parameter. Otherwise, your domain name may be inaccessible to specific users.

  • Record Value: Enter the domain name that is mapped to an IP address.

  • TTL Period: Enter a TTL value for the CNAME record. A smaller TTL value indicates that record updates take effect more quickly. The default value of TTL Period is 10 Minutes.

    image..png

Add an MX record

Scenario

To ensure that your mailbox can receive emails, you must add an MX record for the mailbox. An MX record specifies the mail server that receives emails based on the email address suffix. For example, if a user sends an email to vincen@example.com, the system uses the MX record of example.com for DNS resolution. The system forwards the email to the email server that corresponds to the resolved email address based on the priority of the MX record.

Procedure

An email address that is registered with Alibaba Mail is used in this example. Specify the following parameters:

  • Record Type: Select MX.

  • Hostname: Enter the prefix of the subdomain or an at sign (@) as required. If the email address is xxx@dns-example.com, enter @. If the email address is xxx@mail.xxx.com, enter mail.

  • DNS Request Source: Select Default. You must specify this parameter. Otherwise, your email address may be inaccessible to specific users.

  • Record Value: Enter the MX record value that is obtained from the email service provider. In this example, the MX record value provided by Alibaba Mail is mx1.qiye.aliyun.com.

  • MX Priority: Enter the MX record priority that is obtained from the email service provider. A smaller value indicates a higher priority. The following figure shows how to configure the MX record. For example, the system attempts to forward an email to mx1.qiye.aliyun.com, which has an MX priority of 5. If the attempt fails, the system forwards the email to mx2.qiye.aliyun.com, which has an MX priority of 10.

  • TTL Period: Enter a TTL value for the MX record. A smaller TTL value indicates that record updates take effect more quickly. The default value of TTL Period is 10 Minutes.

    image..png

Note: The preceding figure only shows how to add an MX record. To create a mailbox, you must also add CNAME and TXT records. For more information about the required DNS records, contact your email service provider. If you are using Alibaba Mail, add the records by referring to Configure DNS records for your mailbox.

Add an AAAA record

Scenario

If you want visitors to access your website by using IPv6 addresses, you can create an AAAA record for the domain name of your website.

Procedure

  • Record Type: Select AAAA.

  • Hostname: Enter the prefix of the subdomain or an at sign (@) as required. If you want to create an AAAA record for the subdomain www.xxx.com, enter www. If you want to create an AAAA record for the domain name dns-example.com, enter @.

  • DNS Request Source: Select Default. You must specify this parameter. Otherwise, your domain name may be inaccessible to specific users.

  • Record Value: Enter the IPv6 address to which the domain name is mapped.

  • TTL Period: Enter a TTL value for the AAAA record. A smaller TTL value indicates that record updates take effect more quickly. The default value of TTL Period is 10 Minutes.

    image..png

Add a TXT record

Scenario

To identify and describe a domain name, you can add a TXT record for the domain name. In most cases, a TXT record is used as a Sender Policy Framework (SPF) record to prevent email spam.

Procedure

  • Record Type: Select TXT.

  • Hostname: Enter the prefix of the subdomain or an at sign (@) as required. If you want to create a TXT record for the subdomain www.dns-example.com, enter www. If you want to create a TXT record for the domain name xxx.com, enter @.

  • DNS Request Source: Select Default. You must specify this parameter. Otherwise, your domain name may be inaccessible to specific users.

  • Record Value: In most cases, a TXT record is used as an SPF record to prevent email spam. The record value of the typical TXT record in the SPF format is v=spf1 a mx ~all. This value specifies that only IP addresses in the A records and MX records of the domain name are allowed to use this domain name to send emails.

  • TTL Period: Enter a TTL value for the TXT record. A smaller TTL value indicates that record updates take effect more quickly. The default value of TTL Period is 10 Minutes.

    image..png

Add an explicit or implicit URL forwarding record

Scenario

To redirect a domain name to another domain name of an existing website, you can create a URL forwarding record.

Prerequisites

An Internet Content Provider (ICP) filing is obtained for the domain name used before URL forwarding.

Procedure

Example: Redirect http://example.com to http://www.aliyun.com:80/.

1. Add an implicit URL forwarding record

The inline frame (iframe) technology instead of the redirection technology is used.

image..png

Expected results

After you enter http://dns-example.com in the address bar of your browser and press Enter, the website that corresponds to http://www.aliyun.com:80/ appears but http://dns-example.com is still displayed in the address bar.

2. Add an explicit URL forwarding record

Permanent redirects (301 redirects) and temporary redirects (302 redirects) are supported.

image..png

Expected results

After you enter http://xxx.com in the address bar of your browser and press Enter, the website that corresponds to http://www.aliyun.com:80/ appears and http://www.aliyun.com:80/ is displayed in the address bar.

Usage notes

Before you add a URL forwarding record, you must obtain an ICP filing for the domain name used before URL forwarding and make sure that the service provider recorded in the ICP filing is Alibaba Cloud.

  • The record value in the URL forwarding record cannot be an IP address.

  • The domain name used before URL forwarding cannot contain underscores (_).

  • URL forwarding does not support wildcard domain names.

  • The domain names used after URL forwarding cannot be in Chinese.

  • Domain names used before URL forwarding support HTTP but do not support HTTPS. The domain names used after URL forwarding support both HTTP and HTTPS.

  • URL forwarding is a special feature of Alibaba Cloud DNS. Alibaba Cloud DNS does not provide the attack defense service for this feature. URL forwarding becomes unavailable if a blackhole attack occurs. In such cases, you must change the hostname of the URL forwarding record to that of the A or CNAME record. Alternatively, you can implement URL forwarding by using NGINX. For more information, see Use NGINX to build a self-managed server for URL forwarding.

Add an NS record

Scenario

To delegate a subdomain to another DNS service provider, you can add an NS record for the subdomain.

Procedure

For example, Alibaba Cloud DNS is responsible for the DNS resolution of dns-example.com. If you want to delegate the subdomain www.dns-example.com from Alibaba Cloud DNS to Tencent Cloud DNSPod, specify the following parameters to add an NS record:

  • Record Type: Select NS.

  • Hostname: Enter the prefix of the subdomain. If the subdomain is www.dns-example.com and you want to delegate the subdomain to Tencent Cloud DNSPod, enter www.

  • DNS Request Source: Select Default. You must specify this parameter. Otherwise, your domain name may be inaccessible to specific users.

  • Record Value: Enter the domain name of the DNS server to which you want to delegate the subdomain. For example, the domain name of the sample DNS server that is provided by Tencent Cloud DNSPod is xxx.dnspod.net.

  • TTL Period: Enter a TTL value for the NS record. A smaller TTL value indicates that record updates take effect more quickly. The default value of TTL Period is 10 Minutes.

image..png

Add an SRV record

Scenario

An SRV record is used to specify a server that hosts a specific service. SRV records are commonly used in directory management for Microsoft operating systems.

Procedure

  • Record Type: Select SRV.

  • Hostname: Enter a hostname in the format of Service name.Protocol type.

    Example: _sip._tcp.

  • DNS Request Source: Select Default. You must specify this parameter. Otherwise, your domain name may be inaccessible to specific users.

  • Record Value: Enter a record value in the format of Priority Weight Port Destination domain name. Separate the items with spaces.

    Example: 0 5 5060 xxx.example.com

  • TTL Period: Enter a TTL value for the SRV record. A smaller TTL value indicates that record updates take effect more quickly. The default value of TTL Period is 10 Minutes.

image..png

Add a CAA record

Scenario

You can add a CAA record for a domain name to authorize a specified certification authority (CA) to issue certificates for the domain name. An unauthorized third-party CA will be rejected if the CA attempts to issue a Secure Sockets Layer (SSL) or Transport Layer Security (TLS) certificate for the domain name.

When you add a CAA record for the domain name of your website, you can authorize a specific CA to issue certificates for the domain name. This prevents HTTPS certificates from being issued by unauthorized CAs and improves website security.

CAA record format

A CAA record is in the format of [flag] [tag] [value]. A CAA record consists of a flag ([flag]) and a tag-value pair ([tag] [value]) that is referred to as a property. You can add multiple CAA records for a domain name.

Field

Description

flag

An unsigned integer that is used to identify the CA. Valid values: 0 and 128. We recommend that you set the value to 0. The value 0 indicates that the flag is ignored if the CA does not recognize the flag.

tag

Valid values: issue, issuewild, and iodef.

  • issue: A CA is authorized to issue a certificate of all types.

  • issuewild: A CA is authorized to issue a wildcard certificate for the hostname.

  • iodef: The authorized CA sends the URL of an invalid certificate request to an email address.

value

The domain name of the CA or the email address that is used to receive notifications of invalid certificate requests.

Procedure

Add the CAA record described in the following table.

Hostname

Record value

@

0 issue "ca.example.com"

image..png

Add a PTR record

Reverse DNS resolution is a process of mapping an IP address to a domain name. To use this feature, contact your data center or host service provider.

If your server is provided by Alibaba Cloud, you can submit a ticket. After-sales support engineers of Alibaba Cloud can help you configure reverse DNS resolution.

FAQ

The following topics are provided to help you troubleshoot issues that you may encounter when you add DNS records: