RFC 1035 - Domain Names - Implementation and Specification
Status: Internet Standard (STD 13)
Obsoletes: RFC 882, 883, 973
Author: Paul Mockapetris (ISI)
Published: November 1987
Abstract
This RFC describes the details of the domain system and protocol, and assumes that the reader is familiar with the concepts discussed in the companion RFC "Domain Names - Concepts and Facilities" [RFC-1034].
The domain system is a mixture of functions and data types which are an official protocol and functions and data types which are still experimental. Since the domain system is intentionally extensible, new data types and experimental behavior should always be expected in parts of the system beyond the official protocol. The official protocol parts include standard queries, responses and the Internet class RR data formats (e.g., host addresses).
Importance
RFC 1035 together with RFC 1034 form the core specification of DNS:
- RFC 1034: Concepts and Facilities (theory and architecture)
- RFC 1035: Implementation and Specification (protocol and formats)
This RFC provides all the technical details needed to implement DNS, including:
- 📦 Message format and encoding
- 📋 Resource record definitions
- 📁 Zone file format
- 🖥️ Name server implementation
- 🔍 Resolver implementation
Table of Contents
2. Introduction
- 2.1 Overview
- 2.2 Common configurations
- 2.3 Conventions
- 2.3.1 Preferred name syntax
- 2.3.2 Data Transmission Order
- 2.3.3 Character Case
- 2.3.4 Size limits
3. Domain Name Space and RR Definitions
- 3.1 Name space definitions
- 3.2 RR definitions
- 3.2.1 Format
- 3.2.2 TYPE values
- 3.2.3 QTYPE values
- 3.2.4 CLASS values
- 3.2.5 QCLASS values
- 3.3 Standard RRs
- 3.3.1 CNAME RDATA format
- 3.3.2 HINFO RDATA format
- 3.3.3 MB RDATA format (EXPERIMENTAL)
- 3.3.4 MD RDATA format (Obsolete)
- 3.3.5 MF RDATA format (Obsolete)
- 3.3.6 MG RDATA format (EXPERIMENTAL)
- 3.3.7 MINFO RDATA format (EXPERIMENTAL)
- 3.3.8 MR RDATA format (EXPERIMENTAL)
- 3.3.9 MX RDATA format
- 3.3.10 NULL RDATA format (EXPERIMENTAL)
- 3.3.11 NS RDATA format
- 3.3.12 PTR RDATA format
- 3.3.13 SOA RDATA format
- 3.3.14 TXT RDATA format
- 3.4 Internet specific RRs
- 3.4.1 A RDATA format
- 3.4.2 WKS RDATA format
- 3.5 IN-ADDR.ARPA domain
- 3.6 Defining new types, classes, and special namespaces
4. Messages
- 4.1 Format
- 4.1.1 Header section format
- 4.1.2 Question section format
- 4.1.3 Resource record format
- 4.1.4 Message compression
- 4.2 Transport
- 4.2.1 UDP usage
- 4.2.2 TCP usage
5. Master Files
- 5.1 Format
- 5.2 Use of master files to define zones
- 5.3 Master file example
6. Name Server Implementation
- 6.1 Architecture
- 6.1.1 Control
- 6.1.2 Database
- 6.1.3 Time
- 6.2 Standard query processing
- 6.3 Zone refresh and reload processing
- 6.4 Inverse queries (Optional)
- 6.5 Completion queries and responses
7. Resolver Implementation
- 7.1 Transforming a user request into a query
- 7.2 Sending the queries
- 7.3 Processing responses
- 7.4 Using the cache
Glossary
References
Quick Reference
DNS Message Format
+---------------------+
| Header | 12 bytes
+---------------------+
| Question | variable
+---------------------+
| Answer | variable
+---------------------+
| Authority | variable
+---------------------+
| Additional | variable
+---------------------+
DNS Header Format (12 bytes)
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RCODE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QDCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ANCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| NSCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ARCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
Common RR Types
| TYPE | Value | Description |
|---|---|---|
| A | 1 | Host address |
| NS | 2 | Authoritative name server |
| CNAME | 5 | Canonical name (alias) |
| SOA | 6 | Start of authority |
| PTR | 12 | Domain name pointer |
| MX | 15 | Mail exchange |
| TXT | 16 | Text strings |
| AAAA | 28 | IPv6 address (RFC 3596) |
Response Codes (RCODE)
| Value | Name | Description |
|---|---|---|
| 0 | NOERROR | No error |
| 1 | FORMERR | Format error |
| 2 | SERVFAIL | Server failure |
| 3 | NXDOMAIN | Name does not exist |
| 4 | NOTIMP | Not implemented |
| 5 | REFUSED | Refused |
Size Limits
| Item | Limit | Description |
|---|---|---|
| Label | 63 bytes | Maximum length of a single label |
| Domain name | 255 bytes | Maximum length of a full domain name |
| UDP message | 512 bytes | Default UDP message size |
| TCP message | 65535 bytes | Maximum TCP message size |
| TTL | 2^31-1 seconds | Maximum time-to-live |
Relationship with RFC 1034
| RFC 1034 | RFC 1035 |
|---|---|
| Concepts and theory | Implementation and protocol |
| Domain name space structure | Message format |
| Name server functions | Name server implementation |
| Resolver concepts | Resolver implementation |
| Zone management | Zone file format |
Implementation Requirements
MUST Implement
- ✅ Standard queries and responses
- ✅ A, NS, CNAME, SOA, PTR, MX records
- ✅ UDP transport (512 bytes)
- ✅ Message compression
- ✅ Case-insensitive comparison
SHOULD Implement
- ✅ TCP transport (for large responses)
- ✅ Zone transfer (AXFR)
- ✅ Caching and TTL handling
- ✅ Recursive query support
MAY Implement
- Inverse queries
- Experimental RR types
- Dynamic updates
Related RFCs
- RFC 1034: DNS Concepts and Facilities (companion document)
- RFC 2181: DNS Specification Clarifications
- RFC 2308: Negative Caching of DNS Queries
- RFC 3596: DNS Extensions for IPv6
- RFC 4033-4035: DNSSEC
- RFC 6891: EDNS(0)
- RFC 8499: DNS Terminology
Online Resources
Companion Document: RFC 1034 - DNS Concepts and Facilities
Next Chapter: 2. Introduction