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

Record Set Types and Configuration Rules

Record Set Types and Configuration Rules

Private zones support the following record set types: A, CNAME, MX, AAAA, TXT, SRV, NS, SOA, and PTR. Table 1 lists the record set types and configuration rules.

Table 1 Record set types and configuration rules

Record Set Type

Description

Rule

Example

A

Maps a domain name to specified IPv4 addresses.

Enter the IPv4 addresses mapped to the domain name.

You can enter up to 50 different IP addresses, each on a separate line.

192.168.xx.2

192.168.xx.3

CNAME

Maps one domain name to another or multiple domain names to one.

Enter the domain name to which you want to map your domain names. You can enter only one domain name.

www.example.com

MX

Maps domains to email servers.

Enter email server domain names.

You can enter a maximum of 50 domain names, each on a separate line.

The format is [priority][mail server domain name].

Configuration rules:
  • priority: priority for an email server to receive emails. A smaller value indicates a higher priority.
  • mail server domain: domain name provided by the email service provider

10 mailserver.example.com.

20 mailserver2.example.com.

AAAA

Maps domain names to IPv6 addresses.

Enter IPv6 addresses mapped to the domain name.

You can enter up to 50 different IP addresses, each on a separate line.

ff03:0db8:85a3:0:0:8a2e:0370:7334

TXT

Identifies a domain name.

Scenarios:

  • Record DKIM public keys to prevent email fraud.
  • Record the identity of domain name owners to facilitate domain name retrieval.

Enter text content as required.

Configuration rules:

  • Text record values must be enclosed in double quotation marks.
  • One or more text record values are supported, each on a separate line.

    A maximum of 50 text record values can be entered.

  • A single text record value can contain multiple character strings, each of which is double quoted and separated from others using a space.

    One character string cannot exceed 255 characters.

    A value must not exceed 4,096 characters.

  • The value cannot be left blank.
  • The text cannot contain a backslash (\).
  • Single text record:

    "aaa"

  • Multiple text records:

    "bbb"

    "ccc"

  • A text record that contains multiple strings:

    "ddd" "eee" "fff"

  • SPF TXT record:

    "v=spf1 a mx -all"

    Only IP addresses in the A and MX record sets are authorized to send emails using this domain name.

SRV

Records servers providing specific services.

Enter server domain names as required.

You can enter a maximum of 50 domain names, each on a separate line.

The value format is [priority] [weight] [port] [server domain name].

Configuration rules:

  • The priority, weight, and port number range from 0 to 65535.
  • A smaller value indicates a higher priority.
  • A larger value indicates a larger weight.
  • The server domain name is the domain name of the target server.

    Ensure that the domain name can be resolved.

NOTE:

If the record set values have the same priority, requests to the domain name will be routed based on weights.

2 1 2355 example_server.test.com

NS

Delegates subdomains to other name servers.

For private zones, an NS record set is created by default and cannot be added manually.

This type of record set is created by default and cannot be added manually.

This type of record set is created by default and cannot be added manually.

SOA

Identifies the base information about a domain name. The SOA record set is automatically generated by the DNS service and cannot be added manually.

This type of record set is created by default and cannot be added manually.

This type of record set is created by default and cannot be added manually.

PTR

Maps IP addresses to a domain name.

Private domain name mapped to the private IP address. You can specify only one domain name.

PTR record sets can only be added to private domain names whose top-level domain is in-addr.arpa.

www.example.com

Wildcard Resolution Rules

DNS allows you to set the record set name to a wildcard (*) (for example, *.example.com). In this way, access requests to all subdomains will be resolved to the same record set.

If you configure a wildcard record set for a domain name and add multiple record sets of the same record type for a specific subdomain, the priority rule for domain name resolution is as follows: exact record set query > wildcard record set query.

Take example.com as an example.

  1. Configure a wildcard record set and a record set with its name specified.

    Subdomain

    Record Set Type

    Value

    *.example.com

    A

    192.168.xx.2

  2. Configure record sets with the same type for subdomain www.example.com.

    Subdomain

    Record Set Type

    Value

    www.example.com

    A

    192.168.xx.3

    *.example.com

    A

    192.168.xx.2

    When a user accesses the domain name www.example.com, 192.168.xx.3 is returned.

    Rule: If both wildcard and exact domain name queries are matched, the exact domain name query result prevails.

TTL Setting Rules

Time-To-Live (TTL) specifies how long the local DNS server (Local DNS) should cache a record. It is measured in seconds. Common TTL values include 300 seconds (5 minutes), 3,600 seconds (1 hour), and 86,400 seconds (24 hours). The default TTL value for Huawei Cloud DNS is 300 seconds.

When receiving a query for a domain name, the local DNS server queries the private DNS server and then caches the obtained record to the local server. The cache period is defined by the TTL value specified in the record.

  • During this TTL period, if the local DNS server receives requests for this domain name again, it returns the cached record without requesting the record from the private DNS server.
  • When the TTL expires, the local DNS server clears the cached records. If the local DNS server receives a query for the domain name, it queries the private DNS server for the domain to get a fresh record and caches the record.
Table 2 Application scenarios of TTL

TTL Setting

Scenario

Description

Increase the TTL value.

Reducing network traffic

A larger TTL value allows DNS records to be cached on the client or server for a longer period. This reduces queries to the DNS server and network load.

Faster response

In IP packets, a larger TTL value allows packets to survive longer on the network. This reduces the number of requests and prevents network congestion.

Stable network

In a stable network with low packet loss, a large TTL value can improve data transmission efficiency by avoiding the need for retransmissions.

Decrease the TTL value.

Quick update

  • For frequently updated content such as that from news websites or social media, a small TTL ensures that users can obtain the latest information promptly and reduces the delay caused by caching.
  • A small TTL can quickly clear the old cache and ensure faster update of DNS records. This ensures that the clients can use the latest records sooner.

Testing and diagnosis

In network tests, if you set a small TTL value, packets will not stay on the network for a long time. This allows you to quickly identify, trace, analyze, and troubleshoot network issues.

Dynamic network environment

A small TTL value can minimize the impact of outdated routing data on a network where routes are frequently changing. This improves network adaptability and response speed.

Reducing network congestion

A small TTL value can help prevent network congestion, particularly in bandwidth-constrained environments.

To set the TTL value, you need to consider both the stability and update requirements of records. Set a long TTL for stable records and a short TTL for frequently changing records. Pay attention to the following:

  • A balance between load and response: When adjusting the TTL value, you need to balance the network load and response speed. This aims to prevent delays in updates out of a high TTL value or load increase out of a low TTL value.
  • Network environment evaluation: You need to set an appropriate TTL value after considering both the network stability and packet loss rate.
  • Monitoring and testing: After adjusting the TTL value, you need to monitor and test its impact to ensure the desired outcome and make further adjustments if needed.
  • Change management: Before changing a DNS record, such as changing the server IP address, you are advised to reduce the TTL value so that DNS caches expire faster. This allows for quicker adoption of the new record. Once the change is fully propagated, you can set the TTL to its original value.