Recent from talks
Nothing was collected or created yet.
SOA record
View on WikipediaA start of authority record (abbreviated as SOA record) is a type of resource record in the Domain Name System (DNS) containing administrative information about the zone, especially regarding zone transfers. The SOA record format is specified in RFC 1035.[1]
Background
[edit]Normally DNS name servers are set up in clusters. The database within each cluster is synchronized through zone transfers. The SOA record for a zone contains data to control the zone transfer. This is the serial number and different timespans.
It also contains the email address of the responsible person for this zone, as well as the name of the primary master name server. Usually the SOA record is located at the top of the zone. A zone without a SOA record does not conform to the standard required by RFC 1035.
Structure
[edit]- NAME
- Name of the zone. @ refers to the $ORIGIN (often the apex) in BIND syntax.
- CLASS
- Zone class (all but universally IN for Internet)
- TYPE
- SOA, abbreviation for start of authority
- TTL
- Time-to-live
- MNAME
- Primary master name server for this zone
- UPDATE requests should be forwarded toward the primary master[2]
- NOTIFY requests propagate outward from the primary master[3]
- RNAME
- Email address of the administrator responsible for this zone. (As usual, the email address is encoded as a name. The part of the email address before the @ becomes the first label of the name; the domain name after the @ becomes the rest of the name. In zone-file format, dots in labels are escaped with backslashes; thus the email address
john.doe@example.comwould be represented in a zone file asjohn\.doe.example.com.) - SERIAL
- Serial number for this zone. If a secondary name server slaved to this one observes an increase in this number, the slave will assume that the zone has been updated and initiate a zone transfer.
- REFRESH
- Number of seconds after which secondary name servers should query the master for the SOA record, to detect zone changes. Recommendation for small and stable zones:[4] 86400 seconds (24 hours).
- RETRY
- Number of seconds after which secondary name servers should retry to request the serial number from the master if the master does not respond. It must be less than Refresh. Recommendation for small and stable zones:[4] 7200 seconds (2 hours).
- EXPIRE
- Number of seconds after which secondary name servers should stop answering requests for this zone if the master does not respond. This value must be bigger than the sum of Refresh and Retry. Recommendation for small and stable zones:[4] 3600000 seconds (1000 hours).
- MINIMUM
- Used in calculating the time to live for purposes of negative caching. Authoritative name servers take the smaller of the SOA TTL and the SOA MINIMUM to send as the SOA TTL in negative responses. Resolvers use the resulting SOA TTL to understand for how long they are allowed to cache a negative response. Recommendation for small and stable zones:[4] 172800 seconds (2 days). Originally this field had the meaning of a minimum TTL value for resource records in this zone; it was changed to its current meaning by RFC 2308.[5]
Sample SOA record
[edit]Sample SOA record for example.org, in BIND syntax.
$TTL 86400
@ IN SOA ns.icann.org. noc.dns.icann.org. (
2020080302 ;Serial
7200 ;Refresh
3600 ;Retry
1209600 ;Expire
3600 ;Negative response caching TTL
)
Serial number changes
[edit]Several methods have been established for updates to the SERIAL field of a zone's SOA record:
- The serial number begins at 1, and is simply incremented at every change.
- The serial number contains the date of the last change (in ISO 8601 basic format) followed by a two-digit counter. For example, the fifth change made on 14 March 2017 (2017-03-14 in ISO 8601) would have the serial number 2017031404. This method is recommended in RFC 1912.[6]
- The serial number is the time of last modification to the zone's data file expressed as the number of seconds since the UNIX epoch. This method is used by default in the djbdns suite.[7] Although it uses a 32-bit counter, it is not susceptible to the year 2038 problem due to the effect of serial number arithmetic.
References
[edit]- ^ Mockapetris, P.V. (November 1987). "RFC 1035 – Domain names – implementation and specification". Network Working Group. doi:10.17487/RFC1035. Retrieved 2017-12-28.
- ^ Thomson, S.; Rekhter, Y.; Bound, J.; Bound, J. (April 1997). Vixie, P (ed.). "RFC 2136 – Dynamic Updates in the Domain Name System (DNS UPDATE)". Network Working Group. doi:10.17487/RFC2136. Retrieved 2017-12-28.
- ^ Vixie, P. (August 1996). "RFC 1996 – A Mechanism for Prompt Notification of Zone Changes (DNS NOTIFY)". Network Working Group. doi:10.17487/RFC1996. Retrieved 2017-12-28.
- ^ a b c d "RIPE 203 – Recommendations for DNS SOA Values". Network Working Group. 1999-06-07. Retrieved 2017-12-28.
These recommendations are aimed at small and stable DNS zones.
- ^ Andrews, M. (March 1998). "RFC 2308 – Negative Caching of DNS Queries (DNS NCACHE)". Network Working Group. doi:10.17487/RFC2308. Retrieved 2017-12-28.
- ^ Barr, D. (February 1996). "RFC 1912 – Common DNS Operational and Configuration Errors". Network Working Group. doi:10.17487/RFC1912. Retrieved 2017-12-28.
- ^ Bernstein, D.J. "How to run a DNS server in place of an existing BIND server". Retrieved 2023-03-13.
SOA record
View on Grokipedia| Field | Description | Data Type |
|---|---|---|
| MNAME | The domain name of the primary (source) name server for the zone. | Domain name |
| RNAME | The domain name representing the email address of the zone administrator (e.g., "admin.example.com" for [email protected]). | Domain name |
| SERIAL | An unsigned 32-bit integer tracking the zone's revision; increments with changes to trigger updates. | Unsigned 32-bit integer |
| REFRESH | The time interval (in seconds) at which secondary servers should check for zone updates from the primary. | Unsigned 32-bit integer |
| RETRY | The time interval (in seconds) before a secondary server retries a failed refresh attempt. | Unsigned 32-bit integer |
| EXPIRE | The time (in seconds) after which a secondary server considers the zone data invalid if it cannot contact the primary. | Unsigned 32-bit integer |
| MINIMUM | The default Time to Live (TTL) value (in seconds) applied as a floor to other resource records in the zone when responding to queries. | Unsigned 32-bit integer |
Introduction
Definition and Purpose
The Start of Authority (SOA) record is a type of Domain Name System (DNS) resource record with type code 6 that must exist exactly once per DNS zone, marking the beginning of the zone's authoritative data and defining the scope of administrative control for that domain.[3] As the foundational record in a zone file, it declares the zone's authority within the DNS hierarchy, serving as the root of the zone's namespace and informing resolvers and secondary servers about the boundaries of authoritative information for the domain.[4] The primary purpose of the SOA record is to specify the primary name server responsible for the zone, provide contact information for the domain administrator, and include parameters that enable secondary servers to perform zone transfers and manage caching effectively.[3] This configuration ensures coordinated maintenance across distributed DNS infrastructure, allowing secondary servers to synchronize data from the primary source while adhering to defined refresh and expiration guidelines.[5] In DNS operations, the SOA record supports zone transfers by providing parameters for synchronization between primary and secondary servers, and its MINIMUM field sets the default TTL for negative caching responses, including NXDOMAIN, as clarified in RFC 2308.[3][6] It declares the zone's authority but does not enforce update authorization. Unlike NS records, which simply identify the name servers hosting the zone, the SOA record supplies the essential administrative details needed for operational integrity.[3]Historical Development
The Start of Authority (SOA) record was introduced in 1987 as a fundamental component of the Domain Name System (DNS) specification outlined in RFC 1035, authored by Paul Mockapetris. This record type emerged as part of the effort to establish a hierarchical, distributed naming system for the Internet, supplanting earlier centralized approaches like the hosts.txt file maintained by the Stanford Research Institute for the ARPANET. The SOA record was designed to hold administrative and authoritative information for a DNS zone, marking the beginning of standardized mechanisms for managing domain data across a growing network. In its early conception, the SOA record addressed the need for decentralized administration during the ARPANET's evolution into a more robust Internet infrastructure. By enabling zone administrators to specify contact details, version tracking, and timing parameters, it facilitated the transition from monolithic host tables to a federated system where multiple entities could independently manage portions of the namespace. This was crucial in the late 1980s, as the network expanded beyond academic and military use, requiring reliable methods for propagating updates without central bottlenecks. Subsequent refinements clarified and extended the SOA record's functionality through targeted RFC updates. RFC 1982, published in 1996, provided precise rules for serial number arithmetic to prevent issues in zone transfer comparisons, ensuring consistent versioning across resolvers. In 1998, RFC 2308 redefined the MINIMUM field to serve as the Time to Live (TTL) for negative caching, improving efficiency in handling non-existent domain queries. In 2019, RFC 8499 incorporated the SOA record into an updated DNS terminology glossary. In November 2024, RFC 9499 further updated the DNS terminology, affirming its enduring role in protocol documentation.[7] The SOA record gained widespread adoption in the late 1980s through its integration into the Berkeley Internet Name Domain (BIND) software, the first widely deployed DNS implementation, which became the de facto standard for Internet servers. This timeline was driven by the Internet's rapid growth, necessitating dependable zone transfer protocols to maintain data consistency amid increasing domain registrations and inter-domain communications.Record Structure
Field Components
The SOA record consists of seven fields defined in the Resource Record Data (RDATA) portion, which collectively provide administrative and operational parameters for a DNS zone.[3] These fields are represented in the DNS master file format, where domain names are subject to standard compression techniques to optimize storage and transmission, and all time intervals are expressed in seconds as 32-bit unsigned integers unless otherwise specified.[3] The fields must be present in every SOA record, with MNAME and RNAME as required domain names, and the remaining five as numeric values essential for zone synchronization and caching.[3] The first field, MNAME, specifies the hostname of the primary name server responsible for the zone, serving as the authoritative source for zone data updates and transfers.[3] It is encoded as a standard domain name and must resolve to a valid name server address within the DNS hierarchy.[3] The second field, RNAME, identifies the email address of the zone administrator in a domain name format, where the "@" symbol is replaced by a dot (e.g., "hostmaster.example.com" corresponds to [email protected]).[3] This field functions as the contact point for administrative issues related to the zone, also encoded as a compressed domain name.[3] The third field, SERIAL, is a 32-bit unsigned integer representing the version number of the zone file, incremented by the primary server whenever changes occur to detect updates during transfers.[3] It supports sequence space arithmetic to handle wrap-around from its maximum value of 4294967295, ensuring reliable change tracking without gaps.[3] The fourth field, REFRESH, defines the suggested time interval at which secondary name servers should check the primary for zone updates, typically ranging from 1200 seconds (20 minutes) to 43200 seconds (12 hours) depending on update frequency.[8] This 32-bit unsigned integer promotes efficient synchronization while minimizing unnecessary queries.[3] The fifth field, RETRY, specifies the time interval a secondary server should wait before retrying a failed refresh attempt, often set as a fraction of REFRESH, such as 1200 to 7200 seconds (20 minutes to 2 hours).[8] As a 32-bit unsigned integer, it ensures resilience against temporary connectivity issues without overwhelming the primary server.[3] The sixth field, EXPIRE, indicates the maximum duration a secondary server can continue serving zone data as authoritative after failing to contact the primary, commonly configured between 1209600 and 2419200 seconds (14 to 28 days) to balance availability and data staleness.[8] This 32-bit unsigned integer value must exceed the REFRESH interval to prevent premature invalidation during outages.[3] The seventh field, MINIMUM, establishes the default time-to-live (TTL) value applied to all resource records from the zone in query responses, as well as the TTL for negative caching of non-existent data, typically set between 86400 and 432000 seconds (1 to 5 days) for stable zones.[8] Represented as a 32-bit unsigned integer in seconds, it acts as a floor for TTLs, overriding lower values in individual records to enforce consistent caching behavior.[3]Data Encoding and Constraints
The SOA record is encoded as a variable-length resource record with type 6 in DNS messages, typically within the Internet (IN) class, consisting of two domain names followed by five 32-bit unsigned integer fields.[3] The domain names for the primary name server (MNAME) and responsible person (RNAME) are represented in the standard DNS wire format, utilizing label-based encoding where each label is preceded by a 1-octet length (0-63), followed by the label characters, and terminated by a zero-length label; these names support pointer-based compression to reduce message size when the same name appears multiple elsewhere in the message.[9] The integer fields—serial number (SERIAL), refresh interval (REFRESH), retry interval (RETRY), expire limit (EXPIRE), and minimum TTL (MINIMUM)—are each encoded as 32-bit unsigned integers in network byte order (big-endian), representing time intervals in seconds, with no additional padding or null terminators between fields.[3] The total RDATA length varies depending on the encoded size of the domain names, which can range from 3 octets (for a single-label name) up to 255 octets per name, resulting in a minimum SOA RDATA size of 26 octets and no fixed maximum beyond the overall DNS message limit of 65535 octets.[9] For the RNAME field, the email address of the responsible person is transformed into a domain name format by replacing the "@" symbol with a dot; for example, "[email protected]" becomes the domain name "hostmaster.example.com", encoded as per the standard domain name rules without any special delimiters.[3] This encoding ensures compatibility with the DNS protocol's domain name handling, treating the mailbox as a hierarchical name under the root. Serial number arithmetic operates modulo , treating the SERIAL as an unsigned 32-bit integer where increments wrap around from 4294967295 to 0, and comparisons use sequence space rules to determine if one value is greater, less than, or equal to another, avoiding ambiguities in the circular space by limiting increments to at most within the expire interval.[10] The time interval fields (REFRESH, RETRY, EXPIRE, MINIMUM) must be positive unsigned 32-bit values, with REFRESH recommended between 1200 and 43200 seconds, EXPIRE at least as large as REFRESH plus several retry attempts (typically 1209600 to 2419200 seconds), and MINIMUM between 86400 and 432000 seconds to balance caching efficiency; values outside these ranges may lead to operational issues like excessive polling or premature data expiration, though the protocol permits any value from 1 to .[3][8] Resolvers encountering invalid fields, such as non-positive times or malformed domain names, typically discard the entire SOA record or response to prevent propagation of errors, as specified in the DNS protocol's error handling.[11] In zone files, the SOA record follows the master file syntax defined for BIND and compatible implementations, presented as a single line or multi-line entry using parentheses to group the fields for readability:example.com. IN SOA ns1.example.com. hostmaster.example.com. ( SERIAL REFRESH RETRY EXPIRE MINIMUM ).[12] The RNAME may be enclosed in double quotes if it contains spaces or special characters, though this is rare given the domain name constraints, and all times are specified in decimal seconds without units.[13] This presentation format facilitates human editing while mapping directly to the binary wire encoding upon loading into a nameserver.[13]
Usage and Examples
Sample SOA Record
A typical SOA record appears at the beginning of a DNS zone file for a domain, defining the authoritative parameters for that zone. The following example illustrates an SOA record for the hypothetical domainexample.com, using standard conventions for field values as specified in the original DNS protocol documentation.[1]
example.com. IN SOA ns1.example.com. hostmaster.example.com. (
2025111001 ; Serial (YYYYMMDDNN format: November 10, 2025, revision 01)
3600 ; Refresh (1 hour)
1800 ; Retry (30 minutes)
604800 ; Expire (1 week)
86400 ; Minimum TTL (1 day)
)
example.com. IN SOA ns1.example.com. hostmaster.example.com. (
2025111001 ; Serial (YYYYMMDDNN format: November 10, 2025, revision 01)
3600 ; Refresh (1 hour)
1800 ; Retry (30 minutes)
604800 ; Expire (1 week)
86400 ; Minimum TTL (1 day)
)
2025111001 represents the date November 10, 2025, followed by a two-digit revision counter starting at 00; this approach facilitates incremental updates while maintaining a 32-bit unsigned integer limit.[14] The refresh interval of 3600 seconds indicates how often secondary servers should check for updates, the retry value of 1800 seconds sets the wait time after a failed refresh attempt, the expire duration of 604800 seconds (one week) defines when secondaries discard the zone if unreachable, and the minimum TTL of 86400 seconds (one day) serves as the default caching time for negative responses unless overridden by individual resource records.[1]
This SOA record is positioned as the first entry in the zone file for example.com, with the domain origin implied by the @ symbol in many configurations, and it inherits or sets a default TTL for the zone unless a separate $TTL directive is used at the file's start.[1]
Variations in serial number formatting exist, such as using a simple incrementing integer or alternative date orders like DDMMYYYYNN in some legacy systems, though the YYYYMMDDNN convention remains widely recommended for clarity and automation compatibility.[14]
