Networking · 07 · 4 min read

DNS

The phone book of the internet: it turns names like rahimly.com into IP addresses.

What happens when you type a name

  1. 1Your device checks its own cache first.
  2. 2If not found, it asks a resolver (usually your ISP, 1.1.1.1 or 8.8.8.8).
  3. 3The resolver asks a root server → the .com server → rahimly.com’s own name server.
  4. 4The answer (an IP address) comes back and is cached for a while (TTL).

Common record types

RecordMeaning
AName → IPv4
AAAAName → IPv6
CNAMEAlias to another name
MXMail server for the domain
TXTText — e.g. SPF and verification
NSWhich servers answer for the domain

Port and security

Classic DNS uses port 53 (mostly UDP) and is unencrypted, so anyone on the path can see which sites you look up. DNS over HTTPS (DoH) and DNS over TLS (DoT) fix that.