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

browserDNS resolverzone records203.0.113.10
the browser asks a resolver, the resolver asks the records, then connects straight to your IP

key terms

A record

Maps a hostname to an IPv4 address. The workhorse of every zone.

example.com → 203.0.113.10

CNAME

Maps a hostname to another hostname. Change the target once and every alias follows.

www → example.com

resolver

The librarian that walks the DNS chain for you, then caches each answer for its TTL.

your ISP's DNS or 1.1.1.1

TLS certificate

A signed passport binding your domain to your key, issued by a CA browsers already trust.

Let's Encrypt, 90-day

how it works

  1. 1
    Buy the name

    A registrar rents you example.com for about $10 a year. You now control its zone — the records that describe it.

  2. 2
    Point records at the server

    An A record maps example.com to your server IP; www rides along as a CNAME. Resolvers worldwide start answering.

  3. 3
    Issue the certificate

    Certbot proves ownership to Let's Encrypt via the ACME challenge and receives a 90-day certificate, renewed automatically.

  4. 4
    Force 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

1; DNS records at your registrar
2A example.com 203.0.113.10
the real IP of your server
3CNAME www example.com
www is an alias: one place to change
4MX 10 @ mail.example.com
lower number means tried first
5TXT @ "v=spf1 mx ~all"
tells receivers which servers may send mail as you

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
VS

CNAME

  • points a name at a name
  • extra lookup on each hit
  • target change propagates
  • forbidden at the apex
🪤 gotcha

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

🎤 interview

What is DNS?watch ↗

📚 tutorial

A, CNAME, MX in one tablewatch ↗

🔧 useful

www or not www?watch ↗

💎 deep

Free certificates, auto-renewingwatch ↗

💎 deep

Make browsers remember HTTPSwatch ↗

🧠 trivia

What does the S stand for?watch ↗