Internet Backend 05 ๐ DNS Record Types and Propagation
DNS is a distributed database, and the records are the rows. Each record has a type, a name, a value, and a TTL (time to live). The type determines what the value means: an A record maps a name to an IPv4 address, an AAAA record maps a name to an IPv6 address, a CNAME record maps a name to another name, and an MX record maps a domain to a mail server. The TTL determines how long a resolver is allowed to cache the record before it asks the authoritative server again. The propagation is not a push from the authoritative server to the world; it is the gradual expiry of the cached copies in every resolver that has looked up the record. The record is “propagated” when the old TTL has expired everywhere, and the new value is what the resolvers fetch.
The record types are grouped by function. The address records (A, AAAA) map the names to the IP addresses. The alias records (CNAME) map the names to the other names. The delegation records (NS, SOA) describe the zone’s authority and its metadata. The service records (MX, SRV) describe where the services live. The security records (TXT, CAA, and the DNSSEC records) describe the policies and the signatures . The CNAME is the record that cannot coexist with the other records at the same name, and it is forbidden at the zone apex. The SOA is the record that carries the negative-caching TTL, which is the mechanism that tells the resolvers how long to cache the “does not exist” answers.
Key point: The record type determines the meaning of the value, and the TTL determines the cache duration. The propagation is the TTL expiry, not a push. The A and AAAA records map the names to the IP addresses, the CNAME maps the names to the other names (and is forbidden at the apex), the MX and SRV locate the services, the TXT and CAA carry the policies, and the DNSSEC records (RRSIG, DNSKEY, DS, NSEC) provide the cryptographic integrity.
Why the TTL is the propagation mechanism
The caching problem. DNS is a hierarchical database, and the root servers and the TLD servers are queried by every resolver in the world. If every query went to the authoritative server, the load would be unmanageable. The caching is the mechanism that reduces the load: the resolver stores the answer for the TTL duration, and it serves the cached answer for the subsequent queries. The TTL is the contract between the authoritative server and the resolver: “this answer is valid for this many seconds” .
The propagation illusion. The term “propagation” is misleading. The authoritative server does not push the new record to the resolvers. The resolvers keep the old record until the TTL expires, and then they fetch the new record. The propagation time is the maximum TTL of the old record. If the TTL is 3600 seconds, the old record can be cached for up to an hour after the change, and the new record is visible only after that hour . The propagation is the cache expiry, not a broadcast.
The planned-change problem. A record with a long TTL is efficient for the steady state, but it is slow for a planned change. The standard procedure is to lower the TTL before the change, wait for the old TTL to expire, make the change, and then raise the TTL back. The lowering is the mechanism that makes the change visible quickly. The procedure is the trade-off between the steady-state efficiency and the change agility .
The negative caching problem. The “does not exist” answers are also cached. The SOA record’s minimum TTL is the negative-caching TTL, and the resolvers cache the NXDOMAIN for that duration. The negative caching is the mechanism that prevents the repeated queries for the nonexistent names, but it is also the reason a newly created record can be invisible for the negative-cache TTL .
a. The address, alias, and delegation records
The A record maps a name to an IPv4 address. The AAAA record maps a name to an IPv6 address. The two are the address records, and they are the most common. The A record’s value is a 32-bit address, and the AAAA record’s value is a 128-bit address . The two records can coexist at the same name, which is the dual-stack configuration.
www.example.com. 3600 IN A 192.0.2.1
www.example.com. 3600 IN AAAA 2001:db8::1
The CNAME record maps a name to another name. The resolver follows the CNAME and looks up the target. The CNAME is the alias mechanism, and it is used for the subdomains that point to a canonical name, such as the www pointing to the bare domain or a CDN hostname . The CNAME cannot coexist with the other records at the same name, because the alias is exclusive. The CNAME is forbidden at the zone apex because the apex must have the NS and SOA records.
www.example.com. 3600 IN CNAME example.com.
The NS record delegates a zone to the nameservers. The SOA record is the zone’s metadata: the primary nameserver, the contact, the serial number, and the timers. The SOA is the record that the secondary nameservers use to decide when to transfer the zone, and its minimum TTL is the negative-caching TTL .
example.com. 86400 IN NS ns1.example.com.
example.com. 86400 IN SOA ns1.example.com. admin.example.com. (
2024010101 ; serial
7200 ; refresh
3600 ; retry
1209600 ; expire
300 ; minimum (negative TTL)
)
The PTR record maps an IP address to a name. It is the reverse DNS record, and it lives in the in-addr.arpa zone for IPv4 and the ip6.arpa zone for IPv6. The PTR is used for the reverse lookups, the email reputation, and the logging .
b. The service, policy, and security records
The MX record maps a domain to a mail server. The value has a priority and a hostname. The lower priority is preferred, and the multiple records provide the redundancy. The MX is the record that the email delivery uses to find the mail server for the domain .
example.com. 3600 IN MX 10 mail1.example.com.
example.com. 3600 IN MX 20 mail2.example.com.
The SRV record maps a service to a host and a port. It is the generic service record, and it is used for the protocols that need the service discovery, such as the SIP, the XMPP, and the LDAP. The value has a priority, a weight, a port, and a target .
The TXT record stores the arbitrary text. It is the record that carries the SPF, the DKIM, and the DMARC policies for the email authentication, and the domain verification strings for the third-party services . The TXT is the policy record, and the multiple strings can be stored in the same record.
example.com. 3600 IN TXT "v=spf1 include:_spf.example.com ~all"
The CAA record restricts the certificate authorities that are allowed to issue the certificates for the domain. The value has a flag, a tag (issue, issuewild, iodef), and a value. The CAA is the policy that the CAs check before they issue the certificate, and it is mandatory since September 2017 .
example.com. 3600 IN CAA 0 issue "letsencrypt.org"
The DNSSEC records are the integrity mechanism. The RRSIG is the digital signature of the record set. The DNSKEY is the public key that verifies the signature. The DS is the delegation signer record in the parent zone, and it is the link in the chain of trust. The NSEC (or NSEC3) is the record that proves the nonexistence of a name . The DNSSEC does not encrypt the DNS data; it only proves the integrity. The validating resolver checks the signatures from the root down to the zone, and it marks the answer as secure, insecure, bogus, or indeterminate .
Complete Example Session
// ============================================
// PART 1: THE ZONE FILE
// ============================================
$TTL 3600
@ IN SOA ns1.example.com. admin.example.com. (
2024010101 ; serial
7200 ; refresh
3600 ; retry
1209600 ; expire
300 ; minimum (negative TTL)
)
// ============================================
// PART 2: THE DELEGATION
// ============================================
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
// ============================================
// PART 3: THE ADDRESS RECORDS
// ============================================
@ IN A 192.0.2.1
@ IN AAAA 2001:db8::1
www IN A 192.0.2.2
www IN AAAA 2001:db8::2
// ============================================
// PART 4: THE MAIL RECORDS
// ============================================
@ IN MX 10 mail1.example.com.
@ IN MX 20 mail2.example.com.
mail1 IN A 192.0.2.10
mail2 IN A 192.0.2.20
// ============================================
// PART 5: THE POLICY RECORDS
// ============================================
@ IN TXT "v=spf1 mx -all"
@ IN CAA 0 issue "letsencrypt.org"
// ============================================
// PART 6: THE ALIAS
// ============================================
// The CNAME points the subdomain to the bare domain.
// The CNAME is forbidden at the apex (@).
blog IN CNAME www.example.com.
// ============================================
// PART 7: THE REVERSE DNS
// ============================================
// The PTR record lives in the in-addr.arpa zone.
1.2.0.192.in-addr.arpa. IN PTR www.example.com.
// ============================================
// PART 8: THE DNSSEC RECORDS
// ============================================
// The DNSKEY is the public key.
// The RRSIG is the signature of the record set.
// The DS is the delegation signer in the parent zone.
// The NSEC proves the nonexistence.
// ============================================
// PART 9: THE TTL AND THE PROPAGATION
// ============================================
// The TTL is 3600 seconds (1 hour).
// A change is visible after the old TTL expires.
// The planned change: lower the TTL to 300, wait 1 hour, change, raise to 3600.
// ============================================
// PART 10: THE CHECKLIST
// ============================================
// [ ] The A and AAAA records are set.
// [ ] The CNAME is not at the apex.
// [ ] The MX records have the priorities.
// [ ] The TXT records carry the SPF and the verification.
// [ ] The CAA record restricts the CAs.
// [ ] The SOA record has the negative-caching TTL.
// [ ] The DNSSEC records are present if the zone is signed.
// [ ] The TTL is appropriate for the change frequency.
The ten parts covered the zone file, the delegation, the address records, the mail records, the policy records, the alias, the reverse DNS, the DNSSEC records, the TTL and the propagation, and the checklist. The through-line is that the record type determines the meaning, and the TTL determines the propagation.
Quick Reference
The record types
| Type | Purpose | Value |
|---|---|---|
A | IPv4 address | 32-bit address |
AAAA | IPv6 address | 128-bit address |
CNAME | Alias | Another name |
NS | Nameserver delegation | Nameserver hostname |
SOA | Zone metadata | Primary NS, contact, serial, timers |
MX | Mail server | Priority + hostname |
TXT | Text policy | SPF, DKIM, DMARC, verification |
CAA | CA restriction | Flag, tag, value |
PTR | Reverse DNS | Hostname |
SRV | Service locator | Priority, weight, port, target |
RRSIG | DNSSEC signature | Signature of the record set |
DNSKEY | DNSSEC public key | Public key |
DS | Delegation signer | Hash of the child’s DNSKEY |
NSEC | Proof of nonexistence | Next secure record |
The TTL and the propagation
| TTL | Propagation | Use case |
|---|---|---|
| 300 | 5 minutes | The planned change |
| 3600 | 1 hour | The steady state |
| 86400 | 24 hours | The stable records (NS) |
The DNSSEC states
| State | Meaning |
|---|---|
| Secure | The signatures are verified |
| Insecure | The zone is not signed |
| Bogus | The signatures fail |
| Indeterminate | No trust anchor |
Best Practices
โ Do This:
// Use the CNAME only for the non-apex names
blog IN CNAME www.example.com. // โ
// Set the CAA record to restrict the CAs
@ IN CAA 0 issue "letsencrypt.org" // โ
// Lower the TTL before a planned change
// Change the TTL to 300, wait for the old TTL to expire, make the change, raise the TTL.
โ Don’t Do This:
// Use the CNAME at the apex
@ IN CNAME example.com. // the apex needs the NS and SOA // โ
// Use the CNAME with the other records at the same name
www IN CNAME target.com.
www IN A 192.0.2.1 // the CNAME is exclusive // โ
Common Pitfalls
| Pitfall | Why It Happens | Fix |
|---|---|---|
| The change is not visible | The old TTL is cached | Lower the TTL before the change |
The CNAME is rejected | The CNAME is at the apex | Use the A/AAAA or the ALIAS |
| The email is marked as spam | The SPF/DKIM/DMARC is missing | Add the TXT records |
| The certificate issuance fails | The CAA does not allow the CA | Update the CAA record |
| The negative answer is cached | The SOA minimum TTL is high | Lower the negative TTL |
Summary
| Item | Value |
|---|---|
A / AAAA | The IPv4 / IPv6 address |
CNAME | The alias; forbidden at the apex |
NS / SOA | The delegation and the zone metadata |
MX / SRV | The mail and the service locators |
TXT / CAA | The policy records |
PTR | The reverse DNS |
| DNSSEC | RRSIG, DNSKEY, DS, NSEC |
| Propagation | The TTL expiry, not a push |
Key takeaways:
- The record type determines the meaning of the value. The
AandAAAAmap the names to the addresses, theCNAMEmaps the names to the other names, theMXandSRVlocate the services, and theTXTandCAAcarry the policies . - The TTL is the propagation mechanism. The authoritative server does not push the changes; the resolvers cache the records for the TTL duration, and the new value is visible only after the old TTL expires . The planned change requires lowering the TTL before the change .
- The
CNAMEis exclusive and forbidden at the apex. The alias cannot coexist with the other records at the same name, and the apex must have theNSandSOArecords. TheALIASor theA/AAAAis the alternative at the apex. - The
CAArecord is the CA restriction policy. The certificate authorities check it before they issue the certificate, and it is mandatory since 2017 . The missingCAAmeans any CA can issue. - The DNSSEC provides the integrity, not the confidentiality. The
RRSIG,DNSKEY,DS, andNSECrecords prove that the answer matches the zone’s data and was not altered in transit . The DNSSEC does not encrypt the data.
Remember: DNS records are typed values with a TTL. The type is the meaning, and the TTL is the cache duration. The propagation is the TTL expiry, not a push. The A/AAAA map the addresses, the CNAME maps the aliases, the MX and SRV locate the services, the TXT and CAA carry the policies, and the DNSSEC records provide the integrity. The planned change requires lowering the TTL before the change, and the CNAME is forbidden at the apex. The records are the database rows, and the TTL is the contract.
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!