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.
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.
- 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
- 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.
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 |
|
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot