Domain Name System
ActiveHierarchical distributed naming system that translates human-readable domain names into IP addresses for locating internet resources.
In one line
DNS is the internet's naming system, translating domain names into IP addresses. Introduced in RFC 882 and RFC 883 (1983), then standardized in RFC 1034 and RFC 1035 (1987). DNS operates primarily over UDP port 53. Classic DNS had a 512-byte UDP message limit; EDNS(0) (RFC 6891) allows resolvers and servers to advertise larger UDP payload sizes, reducing the need for TCP fallback. Record types include A, AAAA, MX, CNAME, TXT, NS, and DNSSEC types (DNSKEY, DS, RRSIG, NSEC).
Quick Reference
| Field | Size | Description |
|---|---|---|
| Header | 12 bytes | Transaction ID, flags, question/answer counts |
| Question | Variable | Domain name being queried + type + class |
| Answer | Variable | Resource records matching the query |
| Authority | Variable | NS records pointing to authoritative servers |
| Additional | Variable | Extra records (e.g., A records for NS entries) |
Key Characteristics
Query-Response
Client sends a question, resolver returns an answer. Stateless per query.
Cached
Responses have TTL values. Resolvers cache aggressively to reduce latency.
Hierarchical
Root → TLD → Authoritative delegation chain. Each level owns its zone.
UDP-first with EDNS(0)
DNS uses UDP port 53 for speed. Classic DNS had a 512-byte message limit. EDNS(0) (RFC 6891) lets resolvers and servers advertise larger UDP payload sizes (typically 1232–4096 bytes), reducing TCP fallback. TCP is used when a response is truncated (TC bit set) or when the query/response genuinely cannot fit.
Encrypted transports
DNS over TLS (DoT, RFC 7858, port 853) and DNS over HTTPS (DoH, RFC 8484, port 443) encrypt queries and responses. DNS over QUIC (DoQ, RFC 9250) is an emerging encrypted alternative. Standard UDP/TCP DNS is unencrypted and subject to interception.
Message Format
; DNS Query for example.com A record
;; HEADER: ID=0xAB12, QR=0, OPCODE=0, RD=1
;; QUESTION SECTION:
;example.com. IN A
; Sent to 8.8.8.8:53 via UDP; DNS Response
;; HEADER: ID=0xAB12, QR=1, AA=1, RCODE=0
;; ANSWER SECTION:
example.com. 300 IN A 93.184.216.34
example.com. 300 IN A 93.184.216.35
;; AUTHORITY SECTION:
example.com. 86400 IN NS ns1.example.com.