Foundations

DNS, the Internet’s Phonebook

how a name turns into an address

2 min readupdated by Syed Khaleel Ahmed

Computers find each other by numeric IP addresses, but people remember names. The Domain Name System (DNS) is the worldwide system that turns a name such as example.com into the address a computer can connect to.[2]

How a lookup works

When you type a name into a browser:

  1. Your device checks its own cache, then asks a recursive resolver (usually run by your ISP, your company or a public provider).
  2. If the resolver does not know, it asks a root server, which points to the servers for the top-level domain (such as .com).
  3. The TLD server points to the domain's authoritative name server.
  4. The authoritative server gives the final answer, and every step along the way caches it for a while.[1]

How long an answer may be cached is set by its TTL (time to live).

Records you will meet

  • A / AAAA: the IPv4 / IPv6 address for a name.
  • CNAME: an alias pointing one name at another.
  • MX: which servers accept email for the domain.
  • NS: which servers are authoritative for the domain.
  • TXT: free-form text, widely used for email security (SPF, DKIM, DMARC) and for proving you own a domain.

Why DNS matters for security

DNS was designed in a more trusting era, so it is a favorite for attackers and a gold mine for defenders:

  • Cache poisoning / spoofing: feeding a resolver a false answer so users land on the wrong server. DNSSEC adds digital signatures so answers can be verified.
  • Typosquatting and look-alike domains: examp1e.com for example.com, used in phishing.
  • Subdomain takeover: a forgotten DNS record still points at a cloud resource that someone else can claim.
  • DNS tunneling: hiding data inside DNS queries to sneak it past firewalls.
  • Visibility: DNS logs show what every device tried to reach, which helps detect malware calling home.

Ordinary DNS queries travel unencrypted. DNS over HTTPS (DoH) and DNS over TLS (DoT) encrypt them, which helps privacy but can also hide traffic from corporate monitoring if not managed.

Sources

  1. IETF RFC 1034: Domain Names, Concepts and Facilities
  2. Cloudflare Learning Center: What is DNS?

Test yourself

My notes

Private — saved only on this device, never sent anywhere.