Domain names - implementation and specification
obsoletes
- rfc-882 — Domain names: Concepts and facilities
- rfc-883 — Domain names: Implementation specification
- rfc-973 — Domain system changes and observations
updated by
- rfc-1101 — DNS encoding of network names and other types
- rfc-1183 — New DNS RR Definitions
- rfc-1348 — DNS NSAP RRs
- rfc-1876 — A Means for Expressing Location Information in the Domain Name System
- rfc-1982 — Serial Number Arithmetic
- rfc-1995 — Incremental Zone Transfer in DNS
- rfc-1996 — A Mechanism for Prompt Notification of Zone Changes (DNS NOTIFY)
- rfc-2065 — Domain Name System Security Extensions
- rfc-2136 — Dynamic Updates in the Domain Name System (DNS UPDATE)
- rfc-2137 — Secure Domain Name System Dynamic Update
- rfc-2181 — Clarifications to the DNS Specification
- rfc-2308 — Negative Caching of DNS Queries (DNS NCACHE)
- rfc-2535 — Domain Name System Security Extensions
- rfc-2673 — Binary Labels in the Domain Name System
- rfc-2845 — Secret Key Transaction Authentication for DNS (TSIG)
- rfc-3425 — Obsoleting IQUERY
- rfc-3658 — Delegation Signer (DS) Resource Record (RR)
- rfc-4033 — DNS Security Introduction and Requirements
- rfc-4034 — Resource Records for the DNS Security Extensions
- rfc-4035 — Protocol Modifications for the DNS Security Extensions
- rfc-4343 — Domain Name System (DNS) Case Insensitivity Clarification
- rfc-5936 — DNS Zone Transfer Protocol (AXFR)
- rfc-5966 — DNS Transport over TCP - Implementation Requirements
- rfc-6604 — xNAME RCODE and Status Bits Clarification
- rfc-7766 — DNS Transport over TCP - Implementation Requirements
- rfc-8482 — Providing Minimal-Sized Responses to DNS Queries That Have QTYPE=ANY
- rfc-8490 — DNS Stateful Operations
- rfc-8767 — Serving Stale Data to Improve DNS Resiliency
- rfc-9619 — In the DNS, QDCOUNT Is (Usually) One
also
- std-13
Extracted elements (30)
DNS stores multiple values of a type as multiple RRs rather than as multiple values inside a single RR's RDATA. This keeps individual RRs shorter and simplifies caching, at the cost of some efficiency for bulk retrieval.
IPv4 addresses in IN-ADDR.ARPA are written in reversed-octet order so that DNS zones can be delegated to match exactly one network of address space (e.g., 10.IN-ADDR.ARPA covers all of net 10). The awkward reversal is intentional to align zone boundaries with network boundaries.
The original MD/MF dual-type mail exchange design was replaced by a single MX type with a numeric PREFERENCE field. The old scheme caused cache coherence problems: a cache populated by an MF-only query would not signal the absence of MD records, making it impossible to safely use partial results.
Compression pointers may only be used in domain name positions whose format is not class-specific. This ensures name servers and resolvers do not need to understand all possible RR formats in order to follow pointers correctly.
A name server must support multiple concurrent activities and must not block UDP query service while waiting for TCP data (zone refresh or recursive queries). Identical requests from the same client may be treated as duplicates.
All DNS implementations must understand arriving messages that contain compression pointers, even if they choose not to generate pointers in messages they send.
All DNS label comparisons must be done case-insensitively (A=a), assuming ASCII with zero parity. Non-alphabetic codes must match exactly. Original case should be preserved whenever possible when data enters the system.
DNS uses server port 53 (decimal) for both UDP (standard queries) and TCP (zone transfers and other operations). Zone refresh activities must use TCP (virtual circuits) for reliable transfer.
During a zone transfer via AXFR, a master must never send part of one zone version and part of another. If a new version is created mid-transfer, the master should continue with the old version or reset the connection.
The SOA MINIMUM field acts as a floor on the TTL of all RRs sent from a zone; a name server must apply this floor when copying RRs into a response, not when loading the zone.
The Z (reserved) bits in the message header must be zero in all queries and responses.
UDP DNS messages must not exceed 512 bytes (excluding IP/UDP headers). Messages exceeding this limit are truncated and the TC bit must be set in the header.
Zone loading from a master file should be suppressed entirely if any errors are encountered, since a single syntax error (e.g., in delegation RRs) can cause a server to return authoritative errors for an entire subzone.
CLASS values: IN=1 (Internet), CS=2 (CSNET, obsolete), CH=3 (CHAOS), HS=4 (Hesiod). QCLASS adds *=255 (any class).
DNS enforces size limits: labels must be 63 octets or less, total domain names must be 255 octets or less, TTL is a positive 32-bit signed integer, and UDP messages are limited to 512 octets.
DNS messages are divided into five sections: Header (always present), Question (query parameters: QNAME, QTYPE, QCLASS), Answer (RRs answering the query), Authority (RRs pointing to authoritative servers), and Additional (related RRs).
QTYPE values extend TYPE to include AXFR=252 (zone transfer request), MAILB=253 (mailbox-related records), MAILA=254 (obsolete), and *=255 (any record type).
RCODE field in the response header encodes: 0=NoError, 1=FormErr (can't interpret query), 2=ServFail (name server problem), 3=NXDomain (name does not exist, authoritative only), 4=NotImp (unsupported query type), 5=Refused (policy refusal); 6–15 reserved.
RR TYPE values: A=1 (host address), NS=2 (name server), CNAME=5 (alias), SOA=6 (start of authority), MX=15 (mail exchange), TXT=16 (text), PTR=12 (pointer), HINFO=13 (host info). MD=3 and MF=4 are obsolete; types 7–10 are experimental.
The IN-ADDR.ARPA domain provides reverse DNS: an IPv4 address is written in reversed-octet label form (e.g., 10.2.0.52 → 52.0.2.10.IN-ADDR.ARPA) with PTR records pointing to canonical host names. Network-level nodes carry PTR records for gateway discovery.
IN-ADDR.ARPA reverse-DNS data and the forward DNS zone for the same host reside in different zones, so inconsistency between them is possible. Additionally, gateway routing table initialization using DNS requires pre-configured bootstrap name server addresses to avoid a chicken-and-egg dependency.
If a server cannot load zone data from its master file (e.g., syntax errors) or cannot refresh a zone before its EXPIRE deadline, it must answer queries as though it is not authoritative for that zone, effectively falling back to a non-authoritative state until the zone is successfully reloaded.
A RDATA contains a single 32-bit Internet address (ADDRESS field). Hosts with multiple addresses have multiple A records.
DNS message header is 12 bytes containing: ID (16-bit), QR (1-bit), OPCODE (4-bit), AA, TC, RD, RA flags (1-bit each), Z reserved (3-bit, must be zero), RCODE (4-bit), followed by QDCOUNT, ANCOUNT, NSCOUNT, ARCOUNT (each 16-bit unsigned).
Domain name labels are encoded as a one-octet length field followed by that many octets of label data; the high-order two bits of each length octet must be zero, limiting labels to 63 octets. The name is terminated by a zero-length octet (root label).
Message compression replaces a domain name or suffix with a two-octet pointer whose top two bits are both 1 (0xC0 mask), with the remaining 14 bits giving the byte offset from the start of the message (the ID field). Labels begin with two zero bits, making label vs. pointer unambiguous.
MX RDATA encodes a 16-bit PREFERENCE integer (lower value = higher priority) followed by an EXCHANGE domain name identifying the mail-exchange host.
Resource records share a common wire format: NAME (variable domain name), TYPE (2 octets), CLASS (2 octets), TTL (32-bit signed integer in seconds), RDLENGTH (16-bit unsigned), and RDATA (variable, RDLENGTH octets).
SOA RDATA contains MNAME and RNAME (domain names), SERIAL (32-bit unsigned), REFRESH, RETRY, EXPIRE (32-bit time intervals), and MINIMUM (32-bit unsigned minimum TTL for the zone). All time values are in seconds.
TCP DNS messages are prefixed with a 2-byte length field (big-endian) giving the message length excluding the length field itself, allowing the receiver to assemble a complete message before parsing.