DNS
The internet's naming system — record types, resolvers, caching and DNSSEC.
The Domain Name System (DNS) is a distributed directory that maps names such as learn.example to information clients need to reach services. A stub resolver on a device usually asks a recursive resolver to find an answer. If the answer is not cached, the resolver follows referrals through the DNS hierarchy until it reaches a server authoritative for the requested domain.
Remember: DNS is like a contacts list for services. Caching is why changing an entry does not update every copy instantly.
Common record types
Amaps a name to an IPv4 address;AAAAmaps it to IPv6.CNAMEaliases one name to another name.MXidentifies mail exchangers for a domain.TXTstores text used by services, including domain verification and email policies.NSidentifies the authoritative name servers for a zone.
A DNS zone is a portion of the namespace managed together. The authoritative provider publishes its records, while recursive resolvers answer clients and cache responses according to each record’s time to live (TTL). A cached answer can remain visible until its TTL expires, which is why a change is not always seen everywhere immediately.
Query and troubleshoot
On systems with dig, ask a resolver for a record:
dig example.com A
dig example.com MX
dig +trace example.com
The first two queries request specific record types. +trace displays the delegation path from the DNS root, which can help distinguish a problem with a resolver’s cache from a problem in the authoritative delegation. Check the returned status, answer section, TTL, and which server responded; a missing answer is not always a network failure.
When diagnosing a name that points to the wrong service, verify the record at the authoritative provider, check for conflicting records, and account for cached TTLs. For split-horizon DNS, the same name can intentionally return different answers inside and outside an organization, so compare results from the relevant networks.
Integrity and privacy
DNSSEC lets validating resolvers verify signed DNS data and detect tampering; it does not encrypt DNS queries. DNS over HTTPS (DoH) and DNS over TLS (DoT) encrypt the connection between a client and its chosen resolver, but do not by themselves prove that a domain’s answer is trustworthy. These technologies address different parts of DNS security.
DNS knowledge is useful for nearly every internet service. Learn to read record types, follow delegations, understand caching, and verify answers from more than one point in the resolution path.
Trusted references
- RFC 1034: Domain Names — Concepts and Facilities explains the DNS namespace and resolution model.
- RFC 1035: Domain Names — Implementation and Specification specifies core DNS message formats and behavior.
- RFC 4033: DNS Security Introduction and Requirements describes DNSSEC’s data-origin authentication and integrity goals.