The entries in a DNS server's cache are indeed known as Resource Records (RRs).
Resource Records are data elements that define DNS server responses, including name resolution information. Each RR identifies a specific resource, such as a website or a mail server, associated with a domain. Every Resource Record contains specific fields: a domain name, a type identifier, a class, a time-to-live (TTL) value, and the resource data itself.
There are several types of Resource Records, including, but not limited to:
- A (Address) Record: The most common type, it maps a hostname to an IPv4 address.
- AAAA (Quad A) Record: Similar to the A record, but it maps a hostname to an IPv6 address.
- CNAME (Canonical Name) Record: This record is used to alias one name to another.
- MX (Mail Exchange) Record: Used in routing requests to email servers.
- NS (Name Server) Record: Points to a DNS server for the domain.
- PTR (Pointer) Record: Provides the inverse function of an A or AAAA record, mapping an IP address back to a hostname for reverse DNS lookup.
- SOA (Start of Authority) Record: Contains administrative information about the DNS zone, including the primary name server, the email of the domain administrator, the domain serial number, and several timers relating to refreshing the zone.
When a DNS query is made, the DNS server checks its cache for any matching Resource Records. If it finds a match, the server responds to the query with the data from the RR. This information is cached and comes with a TTL value, which determines how long the RR can be kept before it must be discarded or refreshed.