DNS
DNS: The Domain Name System
The Domain Name System is the mechanism by which symbolic host names, such as kz2x.ampr.org are translated into numeric host IP addresses, such as 44.44.48.2. It is heavily used on AMPRNet. Cleverly
DNS is an Internet standard that is defined by a set of "Request for Comment" documents, or RFCs. The current revision of the DNS specification is in RFC1035.
Historical Background
Before DNS, individual sites on the Internet maintained a local mapping of host names to IP addresses in the form of a "hosts" file; this was often a text file resident on each Internet-connected computer. However, as the network grew, this quickly became untenable: not only did the file itself become so large as to be unwieldy and slow to search, keeping it up to date required significant effort. Furthermore, coordinating updates from many different organizations, and avoiding name collisions as new hosts were added, added even more complexity.
A clever insight was that the problem could be addressed using the network itself, by providing a network service that could translate between host names and IP addresses. Early work around this idea ultimately lead to DNS.
Concepts
The DNS on the client/server model, in which client machines send name service queries to DNS servers scattered around the Internet, which in turn, provide answers. The process of answering a query related to a host name is called "resolution." Resolved queries may be "cached" by servers for some period of time, called the "time to live" or TTL, given by the source server.
Domains, Zones, and Authority
Names are hierarchical, and organized into domains: Starting from ".", the "root", and descending through a "top-level" domain (TLD) such ".org", then through an organizational domain such as "ampr". Each such level forms a "domain", so that ".org" and "ampr.org" are separate domains. This organization provides resilience against collisions, since names need only be unique within a domain, and and facilitating separation of administrative concerns.
Collections of domains that fall under a single administrative entity form "zones". A zone is said to be authoritative for the domains under its control, but not otherwise; non-authoritative data typically comes out of caches established in response to earlier queries. Authoritative responses to queries always override cached data.
Servers, Resolvers, and Stub Resolvers
As mentioned, clients resolve queries about domain names by sending those queries to servers, but different kinds of servers play different roles:
- Servers, or Authoritative Servers, are the ultimate sources of authority for domains under some zone. They accept queries answer them, either with resolved data or with an error, such as when a query is issued for name that does not exist.
- Resolvers, or Recursive Servers, are intermediaries; they accept "recursive" queries and forward these to other servers until they receive a definitive reply. They then usually cache the results so that subsequent requests for the same query can be answered quickly. The cached data expires once its TTL is exceeded.
- Stub resolvers are small bits of software embedded in client programs that make DNS queries: these program fragments send queries to remote servers and interpret the results, providing them the rest of the program.
Usually, any program that wants to make use of the DNS will do so via a stub resolver, which will forward the query to some recursive server. The stub resolver learns about what recursive server to send its queries to via some administrative mechanism; for example, a DHCP server might supply the IP address of the server to use.