Skip to main content

DNS Storage

Updated Jan 16, 2018 ·

Overview

DNS servers need a way to store information so they can respond to queries. This data is organized in zones and structured as resource records.

DNS Zones

DNS servers organize their data into zones so they can respond to queries efficiently.

  • Forward lookup zones map domain names to IP addresses
  • Reverse lookup zones map IP addresses back to domain names

Zones allow DNS to handle both normal and reverse queries consistently across the network.

Resource Records (RRs)

Resource records are the building blocks of DNS zones. They store all the necessary information for a domain or IP.

  • Each record stores specific data about a domain or IP
  • Examples include A records for IPv4 and AAAA records for IPv6

Common Record Fields/Format:

FieldDescription
NameThe domain or IP the record refers to
TypeSpecifies the record type (e.g., A=1, NS=2)
ClassUsually IN for Internet
TTLTime the record stays cached
Data LengthSize of the resource data
Resource DataThe actual information stored
info

Zones and resource records are the backbone of DNS, which allows resolvers to retrieve both forward and reverse mappings efficiently.

Resource Record Types

DNS uses different types of resource records (RRs) to store information about domains and IP addresses. Each type serves a specific purpose in resolving names or providing additional data.

Record TypePurposeExample
AMaps a domain to an IPv4 addressexample.com → 93.184.216.34
AAAAMaps a domain to an IPv6 addressexample.com → 2606:2800:220:1:248:1893:25c8:1946
CNAMEAliases one domain to anotherwww.example.com → example.com
MXMail exchange server for emailexample.com → mail.example.com
NSAuthoritative name server for the domainexample.com → ns1.example.net
PTRMaps an IP address back to a domain (reverse lookup)93.184.216.34 → example.com
TXTStores arbitrary text dataSPF record for email verification

For more information, please see Resource Records.