A resource record (RR), often called a DNS record, is the smallest unit of data in the Domain Name System: a single entry that associates an owner name with a typed piece of information, such as an IPv4 address, a mail server or a cryptographic key. Every answer a DNS resolver returns is made of one or more resource records.
All DNS records share one fixed structure, defined in RFC 1035, which is why a single format can carry dozens of record types. Understanding that structure, and the rules that govern how records are grouped, cached and signed, is the foundation for reading zone files, debugging resolution and designing reliable DNS configurations on the Internet.
The fields of a resource record
Every resource record consists of six fields, whether it appears in a zone file or travels inside a DNS message. In the wire format these fields appear in a fixed order, and RDATA is the only part whose layout changes with the record type.
The table below describes each field and its role.
| Field | Size on the wire | Meaning |
|---|---|---|
| Owner name | Variable | Domain name the record belongs to |
| Type | 16 bits | Kind of data, such as A, MX or TXT |
| Class | 16 bits | Protocol family, almost always IN for Internet |
| TTL | 32 bits | Seconds a cache may keep the record |
| RDLENGTH | 16 bits | Length of the data field in bytes |
| RDATA | Variable | Type-specific payload, such as an address |
In a zone file the same record is written in presentation format, for example www.example.com. 3600 IN A 192.0.2.10. Here the owner name is www.example.com., the TTL is 3,600 seconds, the class is IN, the type is A and the RDATA is the IPv4 address. The trailing dot marks a fully qualified name; omitting it makes the name relative to the zone origin, a common source of errors.
Common resource record types
The type field determines what a record means and how resolvers interpret its data. The IANA registry lists more than eighty types, but a small set covers nearly all everyday operations, while newer types support security and service binding.
| Type | RDATA content | Typical use |
|---|---|---|
| A | 32-bit IPv4 address | Map a name to an IPv4 host |
| AAAA | 128-bit IPv6 address | Map a name to an IPv6 host |
| CNAME | Canonical domain name | Alias one name to another |
| MX | Preference value and host name | Route email for a domain |
| NS | Name server host name | Delegate a zone to servers |
| SOA | Primary server, contact, serial, timers | Describe zone authority and refresh |
| TXT | One or more text strings | SPF, verification tokens, policies |
| SRV | Priority, weight, port, target | Locate a service and its port |
| PTR | Domain name | Reverse mapping from address to name |
Security-related types extend the same model. DNSKEY, RRSIG, DS and NSEC records carry the keys, signatures and proofs used by DNSSEC, while HTTPS and SVCB records advertise connection parameters such as supported protocols before a client opens a connection.
Resource record sets and how they behave
Records that share the same owner name, class and type form a resource record set (RRset), and DNS treats the set, not the individual record, as the unit of transfer, caching and signing. A name with three A records therefore has one RRset of three members, which a server returns together.
Several rules follow from this grouping, and violating them produces errors that are hard to trace.
- All records in an RRset should carry the same TTL; RFC 2181 deprecates mixed TTLs, and resolvers use the lowest one.
- DNSSEC creates one RRSIG per RRset, so adding or removing a single record requires re-signing the whole set.
- A CNAME cannot coexist with any other data at the same owner name, apart from DNSSEC records.
- The order of records inside an RRset is not significant, which is the basis for simple round-robin load distribution.
- Exact duplicate records are collapsed, because an RRset is defined as a set without duplicates.
Choosing TTL values for resource records
The TTL decides how long resolvers may serve a record from cache, so it is a direct trade-off between agility and load. A low TTL lets changes take effect quickly but increases query volume and dependence on authoritative servers; a high TTL improves resilience and speed but delays any correction.
The following decision table gives typical starting points; actual values depend on change frequency and failover design.
| Situation | Typical TTL | Reason |
|---|---|---|
| Stable NS and MX records | 1 to 2 days | Rarely change, benefit from long caching |
| Ordinary web host A or AAAA | 1 hour | Balances agility and query load |
| Planned migration window | 60 to 300 seconds | Lower in advance, restore afterward |
| DNS-based failover | 30 to 60 seconds | Clients must notice changes quickly |
| Domain verification TXT | 5 to 60 minutes | Short-lived, checked once by a provider |
A key detail is that lowering a TTL only helps after the old TTL expires. An operator who reduces a one-day TTL to five minutes must wait at least one day before the migration, or many caches will continue serving the old address.
Frequent mistakes with DNS records
Most resource record problems are configuration errors rather than protocol faults, and they tend to recur across organizations of every size.
| Mistake | Effect | Fix |
|---|---|---|
| CNAME at the zone apex | Conflicts with SOA and NS records | Use A and AAAA, or a provider ALIAS |
| Missing trailing dot | Name expands to target.example.com.example.com | Write fully qualified names with a dot |
| MX pointing to a CNAME | Some mail servers reject delivery | Point MX to a name with A or AAAA |
| Multiple SPF TXT records | SPF evaluation returns a permanent error | Merge into a single SPF string |
| SOA serial not increased | Secondary servers keep old data | Increment the serial on every change |
Diagnostic tools such as dig and kdig display records in presentation format, including the remaining TTL in a cache, which makes it straightforward to see whether a resolver holds stale data or the authoritative zone itself is wrong.
Put simply
The Domain Name System works like a huge address book, and each resource record is one line in that book. A line says which name it is about, what kind of information it holds, how long others may remember it, and the information itself.
One line might give a website’s numeric address, another might say where email for a company should go. Every DNS answer is built from these lines, so getting each one right is what keeps websites and email reachable.
In practice
A regional retailer moves its online shop from an old hosting provider to a new cloud platform. Two days before the switch, the administrator lowers the TTL on the shop’s A and AAAA records from 86,400 to 300 seconds, giving resolvers worldwide time to drop the long-cached values.
On migration night the administrator updates both records with the new addresses and increments the SOA serial number so the secondary name servers pick up the change. Within about five minutes most customers reach the new platform, and the old servers see traffic fall almost to zero within an hour. After a week of stable operation the TTL goes back to 3,600 seconds, reducing query load while keeping the migration downtime close to zero.