web dev//DNS

The **Domain Name System** is the phonebook of the internet: it translates a human-readable domain name (`3clabs.io`) into the IP address (`104.18.x.x`) of the machine that answers for it. Nothing on the web is reached by name directly; every visit starts with this lookup.


The Domain Name System is the phonebook of the internet: it translates a human-readable domain name (3clabs.io) into the IP address (104.18.x.x) of the machine that answers for it. Nothing on the web is reached by name directly; every visit starts with this lookup.

It is a distributed, hierarchical system, and no single server holds the whole book. The root servers know who runs each extension (.io, .com), the servers of the extension know which nameservers speak for each domain, and those nameservers, run by whichever provider manages the DNS of the domain, hold the actual answers.

The answers are records kept in the zone of the domain. A maps a name to an IPv4 address and AAAA to an IPv6 one; CNAME makes a name an alias of another name, which is allowed on a subdomain and not on the apex; MX and TXT carry the mail configuration, covered in email records.

Changes are not instant. Each answer is cached for the time its TTL allows, so a change takes from minutes to 48 hours to reach everyone, and during that window old and new answers coexist (propagation).

Cloudflare is one of the largest DNS providers, and the one where a name gets attached to a site as a custom domain.