networking

Stands for: Domain Name System

The distributed, hierarchical naming system that maps names such as example.com to addresses and other typed data.

Applications reach it through the operating system's stub resolver, which hands queries to a recursive resolver; that server answers from its cache or asks authoritative servers. When a name resolves wrongly or not at all, the useful first question is which of those layers holds the answer.

RFC 1034 and RFC 1035 (November 1987) describe three parts: a tree-structured name space with resource records attached to its names, name servers that hold the data, and resolvers that extract it for clients. Authority is divided into zones, each served by redundant name servers, and every record carries a type and a class, so one name can hold addresses, mail data and more. The design goals called for a distributed database with local caching, since one consistent copy of the whole would only grow more expensive.

A message is a header followed by question, answer, authority and additional sections. Servers listen on port 53 over UDP and TCP; a UDP reply is limited to 512 bytes and, when longer, truncated with the TC bit set, the signal to retry over TCP, while EDNS lets client and server agree on larger sizes. Every record carries a TTL, the maximum number of seconds a cache may keep it, and a cached copy counts down.

Most faults are a question of layer. An authoritative server sets the AA bit in its answers and a reply from a resolver's cache does not, so asking the authority and the resolver with dig shows whether the zone or a stale cache is wrong. Resolvers are also where policy sits: RFC 9499 describes policy-implementing resolvers that change answers, for example to block malware sites, sometimes without telling the user.

Also known as: dns, domain name system, name resolution

← All glossary entries