Skip to content

DNS

Also called: Domain Name System

Published:

How does DNS work?

MDN describes DNS as a hierarchical and decentralised naming system for internet-connected resources, which keeps domain names together with associated resources such as IP addresses [3]. RFC 1034 states that the domain name space is a tree, and a node's domain name is the list of labels on the path from that node to the root [1]. The information attached to a name is made up of separate resource records, each with an owner, type, class, TTL and data [1].

Two kinds of program keep this running. Name servers hold the tree's structure and its records. Resolvers fetch information from name servers on behalf of clients, often answering from their cache [1].

What does a DNS lookup look like?

The best-known job of DNS is turning a memorable name such as mozilla.org into a numeric IP address such as 192.0.2.172. That is a DNS lookup; a reverse DNS lookup goes the other way and finds the domain name behind an IP address [3]. A name's IPv4 address lives in an A record as a 32-bit internet address [2]. RFC 1035 lets clients reach name servers over UDP on port 53, and in that original specification UDP messages are limited to 512 bytes, with longer replies truncated [2].

Why was DNS created?

RFC 1034, published in 1987, explains that host names and addresses used to live in a single HOSTS.TXT file maintained by the Network Information Center [1]. Explosive growth in the number of hosts made that unsustainable, so the design favours distributed maintenance and caching. Its primary goal is a consistent name space for referring to resources [1].

Frequently asked questions

Which port does DNS use?

RFC 1035 specifies access to name servers over UDP on port 53.

What is a reverse DNS lookup?

Finding the domain name associated with a given IP address.

Sources

  1. RFC 1034: Domain Names - Concepts and Facilities — IETF
  2. RFC 1035: Domain Names - Implementation and Specification — IETF
  3. DNS - Glossary — MDN Web Docs

Related terms