Home / Articles / Introduction to DNS

Introduction to DNS

The Domain Name System is the phonebook of the internet. When you type a URL into your browser, DNS is what translates that human-readable name into an IP address your computer can actually connect to.

How resolution works

DNS resolution involves a recursive query across a hierarchy of servers. When you request computergenome.com, your operating system first checks its local cache. If there's no cached answer, it hands the query to your recursive resolver — typically provided by your ISP or a service like 1.1.1.1.

The recursive resolver then works up the hierarchy:

  1. It queries a root nameserver (there are 13 root server clusters) which responds with the address of the .com TLD nameserver.
  2. It queries the TLD nameserver for .com, which responds with the authoritative nameserver for computergenome.com.
  3. It queries the authoritative nameserver, which finally returns the IP address.
$ dig computergenome.com +trace

. 518400 IN NS a.root-servers.net.
com. 172800 IN NS a.gtld-servers.net.
computergenome.com. 3600 IN A 216.239.32.21

Common record types

Record Purpose
A Maps a hostname to an IPv4 address
AAAA Maps a hostname to an IPv6 address
CNAME Alias from one hostname to another
MX Mail exchange — where to deliver email
TXT Arbitrary text — used for SPF, DKIM, domain verification
NS Nameserver records for a zone

DNS was designed in 1983 by Paul Mockapetris. RFC 882 and 883 laid out the protocol that billions of devices still use today.

TTL and caching

Every DNS record has a Time To Live (TTL) — a value in seconds that tells resolvers how long to cache the answer. A TTL of 3600 means the record can be cached for one hour. When you change a DNS record (for example, pointing your domain to Cloudflare Pages), propagation time is largely determined by the TTL of the old record.