Domains, DNS & HTTPS
The S in HTTPS stands for “sleep well at night”.
▶ the lesson · narrated sketch video · tap for sound
the intro
DNS is the internet’s phone book: your domain name maps to server addresses through records. HTTPS secures the connection with certificates — free and automatic thanks to Let’s Encrypt. Together they make your app findable and trustworthy.
fun fact ✦
DNS changes can take up to 48 hours to propagate — the internet’s phone book updates slowly.
the docs
the deep dive
the ideas behind the video — concepts, diagrams, a walkthrough and the traps to avoid
Two quiet systems make your app legit. DNS is the phonebook: it turns the name a human typed into the IP a machine needs, cached in layers so the internet does not melt. HTTPS is the passport check: a certificate authority vouches that this key really belongs to your domain, and the traffic is sealed in transit. One makes you findable, the other makes you trustworthy.
phonebook for the name, passport for the connection
key terms
A record
Maps a hostname to an IPv4 address. The workhorse of every zone.
example.com → 203.0.113.10CNAME
Maps a hostname to another hostname. Change the target once and every alias follows.
www → example.comresolver
The librarian that walks the DNS chain for you, then caches each answer for its TTL.
your ISP's DNS or 1.1.1.1TLS certificate
A signed passport binding your domain to your key, issued by a CA browsers already trust.
Let's Encrypt, 90-dayhow it works
- 1Buy the name
A registrar rents you example.com for about $10 a year. You now control its zone — the records that describe it.
- 2Point records at the server
An A record maps example.com to your server IP; www rides along as a CNAME. Resolvers worldwide start answering.
- 3Issue the certificate
Certbot proves ownership to Let's Encrypt via the ACME challenge and receives a 90-day certificate, renewed automatically.
- 4Force HTTPS, add HSTS
301-redirect all HTTP traffic, then send Strict-Transport-Security so browsers never even try plain HTTP again.
the code, explained
a zone, as your registrar shows it
side by side
A record
- points a name at an IP
- one lookup, no hop
- required at the zone apex
- AAAA is its IPv6 twin
CNAME
- points a name at a name
- extra lookup on each hit
- target change propagates
- forbidden at the apex
DNS answers are cached by every resolver between you and your visitor, for exactly as long as each record's TTL says. Cut the TTL to 300 seconds a day before migrating to a new IP — otherwise you will spend the evening explaining to some users why only their phone sees the new site.
quick answers
How long do DNS changes take?
Up to the TTL of the old record. Cached resolvers keep the old answer until it expires — usually minutes to a day. "Propagation" is just a lot of TTLs expiring.
Does a static blog really need HTTPS?
Yes. Without the padlock browsers flag the site, plain HTTP lets anything on the path tamper with your pages, and the faster HTTP/2 requires TLS anyway.
Free certificates — what is the catch?
No catch. Let's Encrypt issues automated 90-day certificates via ACME. The short lifetime is the feature: automation means nobody ever scrambles over an expired cert again.
quick hits about Domains, DNS & HTTPS
short answers · interviews, tips, trivia & hidden gems