SyntaxPilot
Courses/Vibe Coding/Lesson 36
Video coming soonThis lesson’s video is being made

Start with the notes below; the video appears here as soon as it is on YouTube.

Vibe Coding · Lesson 36 of 40

Custom domains and HTTPS

domain nameDNS records (A, CNAME)connecting a domainHTTPS certificatesemail on your domaincommon DNS mistakes

Vibe Coding: build real apps with AI · Episode 36. Every agent run below is real: Claude Code 2.1.323 (model claude-opus-5-5) in print mode (claude -p --permission-mode acceptEdits), on 12 November 2026 (UTC evening), in /home/asha/projects/canteen-web. The agent could edit files but needed approval to run commands, and nobody approved, so it ran nothing. We ran every openssl, named-checkzone, dig, curl, tcpdump and Chromium check ourselves.

A practice lab, not the public internet. canteen.test, hostapp.test and mailhost.test are practice names: the .test ending is reserved for testing and can never be bought. We ran two real BIND 9.18 DNS servers on our own laptop: 127.0.0.10 answers for our domains (the authoritative server) and 127.0.0.11 is a caching resolver, like the one in a Wi-Fi router. "The host" is our app running on 127.0.0.2, later 127.0.0.3. "Asha Practice CA" is our own certificate authority, made with openssl. Nothing was deployed or published on the internet. The ideas, commands and error messages are exactly the ones you meet with a real domain.

What was written by hand: the small canteen app (server.js, public/index.html) was written for this video. Asha, Arjun, Neha, Kabir and aunty are fictional; 482913 is a demo PIN; the DKIM key is a placeholder.

Sources for the hosts and certificates (fetched 13 Nov 2026, IST): Netlify docs, Configure external DNS for a custom domain; Vercel docs, Adding & Configuring a Custom Domain (last updated 16 Sep 2026) and Working with SSL Certificates; Firebase docs, Connect a custom domain (Hosting); Let's Encrypt, Decreasing Certificate Lifetimes to 45 Days (2 Dec 2025). Hosts change their dashboards and values: always copy the records from your own dashboard.

The problem: an app at a number

Every computer on a network has an IP address, a number like 127.0.0.2. Our host (the company whose servers run our app) gave us one, and Asha printed it on a poster:

# the poster on the notice board says: http://127.0.0.2
$ curl http://127.0.0.2/api/menu
[{"id":1,"name":"Samosa","price":15},{"id":2,"name":"Vada pav",...}]

# a week later the host moves our app to a new server: 127.0.0.3
$ curl http://127.0.0.2/api/menu
curl: (7) Failed to connect to 127.0.0.2 port 80 after 0 ms:
      Couldn't connect to server

Numbers change. Posters, bookmarks and shared links don't.

Real-life example: your phone's contacts

Your phone The internet
You tap "Mummy", not 10 digits Domain name: canteen.in, not 127.0.0.2
The contacts app turns name → number DNS: turns a name into an IP address
She gets a new SIM: you update one contact Update one record: every link keeps working

Domain names in plain words

  • Domain name: a human name for an address on the internet, like canteen.in.
  • Registrar: the shop where you register a domain, usually for a year at a time; you renew it every year.
  • Apex (bare, root) domain: canteen.in itself. Subdomain: anything in front of it, like www.canteen.in or staff.canteen.in.
  • Name server: the computer that answers "what's the address for this name?" for a domain.
  • If you forget to renew, the name stops working and someone else can register it. Turn on auto-renew, and read the renewal price before you buy, not just the first-year offer.

DNS records: the lines in the contact list

Record What it says Example
A this name lives at this IPv4 address canteen.test. A 127.0.0.3
AAAA the same, for a newer, longer IPv6 address AAAA 2001:db8::1
CNAME (canonical name) this name is just another name for that name www CNAME canteen-x7k2.hostapp.test.
NS which name server answers for this domain @ NS ns1.canteen.test.
SOA (start of authority) the zone's header: main server, admin, serial number @ SOA ns1... hostmaster... (2026111201 ...)
TXT just text: ownership proofs, email rules "v=spf1 ... ~all"
MX which servers receive email for the domain @ MX 10 mx1.mailhost.test.

Every record has a TTL (time to live): how many seconds other computers may remember the answer. All the records for one domain live in its zone file.

www.canteen.test  --CNAME-->  canteen-x7k2.hostapp.test  --A-->  127.0.0.3
(you type)                    (the host's name)                  (the number)

The obvious way fails: a CNAME at the bare domain (our example)

The host said "point your domain to canteen-x7k2.hostapp.test". Our first try, written by us:

@    IN SOA   ns1.canteen.test. hostmaster.canteen.test. ( 1 ... )
@    IN NS    ns1.canteen.test.
ns1  IN A     127.0.0.10
@    IN CNAME canteen-x7k2.hostapp.test.

$ named-checkzone canteen.test obvious.zone
dns_master_load: obvious.zone:5: canteen.test: CNAME and other data
zone canteen.test/IN: not loaded due to errors.

Why: the bare domain must hold the NS and SOA records that describe the domain itself. A CNAME means "this name has no records of its own; ask that other name". A name can't be an alias and hold its own records at once.

Asking the agent (real)

$ claude -p "We bought a practice domain, canteen.test, and we run our own DNS server (BIND 9) to practise before we buy a real one. Our hosting company told us: point your domain to canteen-x7k2.hostapp.test. Write the zone file dns/canteen.test.zone so that both canteen.test and www.canteen.test open our canteen app. Our name server is ns1.canteen.test at 127.0.0.10. Keep it short and explain each record in one line."

The zone it wrote:

; Zone file for canteen.test (BIND 9)
$ORIGIN canteen.test.
$TTL 3600                                   ; default cache time: 1 hour

@    IN SOA ns1.canteen.test. hostmaster.canteen.test. (
         2026111201 ; serial (YYYYMMDDnn) - bump on every edit
         3600       ; refresh
         900        ; retry
         604800     ; expire
         300 )      ; negative-answer cache time

@    IN NS    ns1.canteen.test.             ; ns1 is the name server for this zone
ns1  IN A     127.0.0.10                    ; where ns1 lives (glue for the NS above)

www  IN CNAME canteen-x7k2.hostapp.test.    ; www is an alias for the hosting company's name

; The bare domain (@) CANNOT be a CNAME: it already holds SOA and NS records,
; and a CNAME may not share a name with anything else. It needs an A record
; with the hosting server's IP. Ask the host for it, then uncomment:
; @  IN A     <hosting-IP>                  ; canteen.test -> the app server

From its reply: "I commented the line out rather than putting in a made-up IP, so the zone still loads." and "If the host's IP changes later, you'll need to update this line." Both right; the second one comes true below.

One missing dot (our slip, real result)

We added the host's IP for the bare domain and checked with dig (a tool that asks a DNS server a question and prints the answer). While editing, we deleted the dot at the end of the host's name:

$ dig @127.0.0.10 canteen.test A +noall +answer
canteen.test.        3600  IN  A      127.0.0.2

www  IN CNAME canteen-x7k2.hostapp.test        ; no dot at the end
$ dig @127.0.0.10 www.canteen.test
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN
www.canteen.test.  IN CNAME canteen-x7k2.hostapp.test.canteen.test.

In a zone file, a name without a final dot is treated as short, and the zone's own name (canteen.test.) is added. NXDOMAIN means "no such name". Full names end with a dot.

Connecting a domain to a real host (from their docs, 13 Nov 2026)

You add the domain in the host's dashboard; it shows the records to create at your DNS provider (often your registrar). We had no host accounts here, so this part is from the docs, not done on screen:

Host Subdomain (www) Bare domain Notes
Netlify CNAME → your site's *.netlify.app name ALIAS / ANAME / flattened CNAME → apex-loadbalancer.netlify.com; fallback A → 75.2.60.5 "It may take a full day for the settings to propagate"; recommends a subdomain as the primary domain with external DNS
Vercel CNAME, unique per project, e.g. d1d4fc829fe7bc7c.vercel-dns-017.com A record (value shown in the project's Settings → Domains) prompts you to add www when you add an apex; Hobby: 50 custom domains per project
Firebase Hosting records the wizard shows TXT ownership record (keep it permanently), then the A records the wizard shows remove old A/CNAME records pointing to other providers and any AAAA records; SSL "may take up to 24 hours"

ALIAS / ANAME / flattened CNAME: a record some DNS providers offer that behaves like a CNAME but answers with a plain IP, so it is allowed at the bare domain.

The A record doesn't follow (real)

The host moved our app again (to 127.0.0.3) and updated its record. www (a CNAME to the host's name) followed; the bare domain (an A record with a fixed number) did not:

$ dig @127.0.0.10 canteen-x7k2.hostapp.test +noall +answer
canteen-x7k2.hostapp.test.  300  IN  A  127.0.0.3
$ dig @127.0.0.10 canteen.test +short
127.0.0.2
$ curl http://canteen.test/api/menu
curl: (7) Failed to connect to canteen.test port 80 after 0 ms: Couldn't connect to server

That's why hosts recommend ALIAS for the apex, or making www the main address and redirecting the bare domain to it.

TTL and propagation (real, two BIND servers)

Your phone asks a resolver (usually your Wi-Fi router's or your internet provider's), and the resolver caches (remembers) answers for the TTL.

$ dig @127.0.0.10 canteen-x7k2.hostapp.test +noall +answer      # the domain's own server
canteen-x7k2.hostapp.test. 300   IN  A      127.0.0.3      # new
$ dig @127.0.0.11 www.canteen.test +noall +answer               # the Wi-Fi resolver
www.canteen.test.          3572  IN  CNAME  canteen-x7k2.hostapp.test.
canteen-x7k2.hostapp.test. 272   IN  A      127.0.0.2      # old, cached: 272 s left
$ curl https://www.canteen.test/api/menu
curl: (7) Failed to connect to www.canteen.test port 443 after 0 ms

# 5 minutes later: the TTL ran out, the resolver asked again
canteen-x7k2.hostapp.test. 300   IN  A      127.0.0.3      # new
$ curl https://www.canteen.test/api/menu
[{"id":1,"name":"Samosa","price":15}, ...]
  • DNS propagation = every resolver in the world expiring its cached copy on its own clock.
  • Long TTL: fewer lookups, slow changes. Short TTL: fast changes, more lookups.
  • Moving hosts? Lower the TTL a day before, make the change, then raise it again.
  • To see the real current answer, ask the domain's own name server: dig @<its name server> name.

HTTPS

Real-life example: a postcard, a sealed envelope, an ID card

Sending a note On the web
A postcard: every postman can read it HTTP: readable by anyone on the network
A sealed envelope: only the receiver opens it HTTPS: encrypted with TLS (old name: SSL)
A school ID card signed by the principal Certificate signed by a certificate authority (CA) the browser trusts

HTTP is a postcard (real, on our own laptop)

$ curl -H "X-Staff-Pin: 482913" http://www.canteen.test/api/orders
# recorded with tcpdump on the same network:
GET /api/orders HTTP/1.1
Host: www.canteen.test
X-Staff-Pin: 482913
HTTP/1.1 200 OK
[{"id":1,"student":"Neha Joshi (9A)","items":["Samosa","Masala chai"]}]

Only record traffic on your own devices and apps. Recording other people's traffic without permission is against the law in many countries.

Asking for HTTPS (real)

$ claude -p "Staff check orders with the staff PIN over school Wi-Fi, and right now it's plain http, so anyone on the Wi-Fi can read the PIN. Add HTTPS to the canteen app for canteen.test and www.canteen.test. We're practising before we buy a real domain, so instead of Let's Encrypt we have our own practice certificate authority in /home/asha/practice-ca (ca.crt and ca.key). Make the server's certificate with openssl, serve the app on port 443, and send anyone who opens http to https. Tell me the exact commands to run."

What it changed: server.js serves HTTPS on port 443 when TLS_CERT and TLS_KEY are set; port 80 only redirects; HTTPS responses send Strict-Transport-Security: max-age=86400 (HSTS: "use HTTPS for this site from now on"); .gitignore gains certs/ so the private key is never committed. The commands it gave (we ran them):

mkdir -p certs && chmod 700 certs
openssl req -new -newkey rsa:2048 -nodes \
  -keyout certs/canteen.key -out certs/canteen.csr -subj "/CN=canteen.test"
chmod 600 certs/canteen.key
cat > certs/canteen.ext <<'EOF'
basicConstraints = critical, CA:FALSE
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
subjectAltName = DNS:canteen.test, DNS:www.canteen.test
EOF
openssl x509 -req -in certs/canteen.csr \
  -CA /home/asha/practice-ca/ca.crt -CAkey /home/asha/practice-ca/ca.key \
  -set_serial 0x$(openssl rand -hex 16) -days 397 -sha256 \
  -extfile certs/canteen.ext -out certs/canteen.crt
openssl verify -CAfile /home/asha/practice-ca/ca.crt certs/canteen.crt

Good advice from its reply: "Browsers check the subjectAltName line, not the CN.", "Copy ca.crt only, never ca.key.", and "If staff instead learn to click past browser warnings, someone on the Wi-Fi can put in a fake certificate and read the PIN anyway."

The HTTPS part of server.js after the fix below:

if (TLS_CERT && TLS_KEY) {
  const HTTPS_PORT = Number(process.env.HTTPS_PORT || 443);
  const HTTP_PORT = Number(process.env.HTTP_PORT || 80);
  const SITE_HOSTS = ["canteen.test", "www.canteen.test"];
  const tls = { cert: fs.readFileSync(TLS_CERT), key: fs.readFileSync(TLS_KEY) };
  https.createServer(tls, (req, res) => {
    res.setHeader("Strict-Transport-Security", "max-age=86400");
    app(req, res);
  }).listen(HTTPS_PORT, HOST);

  http.createServer((req, res) => {
    // Only redirect to our own names, so the Host header can't send people elsewhere.
    const asked = (req.headers.host || "").split(":")[0].toLowerCase();
    const host = SITE_HOSTS.includes(asked) ? asked : SITE_HOSTS[0];
    const port = HTTPS_PORT === 443 ? "" : ":" + HTTPS_PORT;
    const url = req.url.startsWith("/") ? req.url : "/";
    const code = req.method === "GET" || req.method === "HEAD" ? 301 : 308;
    res.writeHead(code, { Location: `https://${host}${port}${url}` });
    res.end();
  }).listen(HTTP_PORT, HOST);
}

Our checks (real)

$ openssl verify -CAfile ca.crt certs/canteen.crt
certs/canteen.crt: OK
$ curl -sI http://www.canteen.test/
HTTP/1.1 301 Moved Permanently
Location: https://www.canteen.test/
$ curl https://www.canteen.test/api/menu         # our CA not trusted yet
curl: (60) SSL certificate problem: unable to get local issuer certificate
$ curl --cacert ca.crt https://www.canteen.test/api/menu
[{"id":1,"name":"Samosa","price":15}, ...]
# the same staff request recorded again: search for the PIN or the name
$ grep -c -E "482913|Neha" sniff_https.txt
0

In Chromium: before trusting our CA, "Your connection is not private" · NET::ERR_CERT_AUTHORITY_INVALID; after, http://www.canteen.test lands on the HTTPS page. On a real host every browser already trusts the CA (Let's Encrypt), so there is no warning.

Certificate errors you'll meet (real)

$ curl --cacert ca.crt https://canteen-x7k2.hostapp.test/api/menu
curl: (60) SSL: no alternative certificate subject name matches target host name 'canteen-x7k2.hostapp.test'
$ openssl x509 -in old.crt -noout -enddate
notAfter=Nov  1 00:00:00 2026 GMT
$ curl --cacert ca.crt https://www.canteen.test:8443/
curl: (60) SSL certificate problem: certificate has expired

Chromium shows NET::ERR_CERT_COMMON_NAME_INVALID (name not on the certificate) and NET::ERR_CERT_DATE_INVALID (expired). Read the code at the bottom of the warning: it tells you what to fix.

The AI mistake: the order that vanished (real)

The order tablet at the counter runs an old script that still posts to the HTTP address:

$ curl -L -d '{"student":"Arjun (10A)","items":["Vada pav"]}' http://www.canteen.test/api/orders
> POST /api/orders HTTP/1.1
< HTTP/1.1 301 Moved Permanently
* Switch from POST to GET
> GET /api/orders HTTP/1.1
< HTTP/1.1 401 Unauthorized
{"error":"Wrong PIN"}

A POST sends data (the order); a GET only asks for something. After a 301, clients are allowed to turn a POST into a GET and drop the body. The request became "list orders" (staff only, needs a PIN), and the old script showed nothing. The agent couldn't run anything, so it never tried an old client: we found the bug by testing an old client too.

The fix (real)

$ claude -p "Bug: the order tablet at the canteen counter still sends orders to http://www.canteen.test/api/orders (its script is old). We tested it with curl: [the output above] Arjun's order was never saved, and nobody saw an error. Fix the redirect so an order sent to http is not lost, and explain why it happened in two lines."
Edit server.js
  const code = req.method === "GET" || req.method === "HEAD" ? 301 : 308;
Reply: "curl and most clients are allowed to turn a POST into a GET after a 301,
  and they drop the body when they do." "A 308 is also permanent, but the client
  must resend the same method and body." "Pointing the script at
  https://www.canteen.test/api/orders is the real fix"

$ curl -L -d '{"student":"Arjun (10A)","items":["Vada pav"]}' http://www.canteen.test/api/orders
< HTTP/1.1 308 Permanent Redirect
> POST /api/orders HTTP/1.1
< HTTP/1.1 201 Created
{"id":1,"student":"Arjun (10A)","items":["Vada pav"]}

Rule: 301 for pages, 308 for anything that sends data, and point every client straight at https:// so data never travels as a postcard.

Certificates expire: renewal

Date Let's Encrypt default certificate lifetime
now (Nov 2026) 90 days
10 Feb 2027 64 days (the default "classic" profile)
16 Feb 2028 45 days

Let's Encrypt: "renewing at a hardcoded interval of 60 days will no longer be sufficient" and "Manually renewing certificates is not recommended". Vercel uses Let's Encrypt and renews 14 to 30 days before expiry; Firebase says a certificate "may take up to 24 hours" after you point DNS. Your job: keep DNS records right so automatic renewal keeps working.

Email on your domain

Record Job
MX (mail exchanger) which servers receive mail for @canteen.test; lower number = tried first
SPF (Sender Policy Framework) one TXT line listing which servers may send as your domain
DKIM (DomainKeys Identified Mail) a public key, so receivers can check your mail was signed by your provider
DMARC what receivers should do with mail that fails; p=none = only report

The agent's records (real run), for a practice provider mailhost.test:

@    IN MX    10 mx1.mailhost.test.
@    IN MX    20 mx2.mailhost.test.
@    IN TXT   "v=spf1 include:_spf.newsletter.test include:_spf.mailhost.test ~all"
mh1._domainkey IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAPLACEHOLDER"
_dmarc IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@canteen.test"

The zone already had an SPF line for Kabir's newsletter tool. The agent merged the two into one line: "A domain can have only one of these ... Two records would make both invalid." It also noticed the DKIM key was a placeholder. We checked:

$ dig @127.0.0.10 canteen.test MX +short
20 mx2.mailhost.test.
10 mx1.mailhost.test.
$ dig @127.0.0.10 canteen.test TXT +short
"v=spf1 include:_spf.newsletter.test include:_spf.mailhost.test ~all"

Common mistakes (real)

Mistake What we saw Why Fix
CNAME at the bare domain (our example) CNAME and other data the apex holds NS and SOA A or ALIAS record
No dot at the end (our slip) status: NXDOMAIN, ...hostapp.test.canteen.test. the zone name is added canteen-x7k2.hostapp.test.
Apex A record, host moved Couldn't connect to server a fixed number ALIAS, or www as the main address
Name missing on the certificate no alternative certificate subject name matches not in the SAN list list every name
Expired certificate certificate has expired renewal broke automatic renewal, correct DNS
301 for a POST (the AI's) Switch from POST to GET, order lost the body is dropped 308 + clients on https://
Two SPF records (the AI avoided it) both become invalid one merged line

DNS checklist before you launch

  • [ ] Bare domain: A or ALIAS, never CNAME
  • [ ] Both names: canteen.in and www.canteen.in
  • [ ] Full names end with a dot (in zone files)
  • [ ] Remove old A, AAAA, CNAME records that point to a previous host
  • [ ] Lower the TTL before a move; then wait
  • [ ] HTTPS works for every name; automatic renewal on
  • [ ] One SPF line; MX working before you print the email address

Mini project: put your own app on a practice domain

  1. Install BIND (sudo apt install bind9 bind9utils) or dnsmasq and serve a zone for myapp.test with an A record for the apex, a CNAME for www, MX, SPF and DMARC.
  2. Check it with named-checkzone and dig @127.0.0.1 ... for every record.
  3. Make a practice CA and a certificate for both names with openssl (the commands above), serve your app over HTTPS, and redirect HTTP with 301 for GET and 308 for everything else.
  4. Test with curl -v: HTTP and HTTPS, with and without www, a POST through the redirect, and the wrong name.
  5. When you buy a real domain, repeat steps 2 and 4 against your host's values.

Practice questions

  1. Your host gives you myshop.netlify.app. Which record do you create for www.myshop.in?
Answer

A CNAME: www CNAME myshop.netlify.app. (copy the exact value from your Netlify dashboard).

  1. Why can't myshop.in itself be a CNAME?
Answer

The apex must hold NS and SOA records, and a CNAME can't share its name with any other record. Use an ALIAS/ANAME/flattened CNAME if your DNS provider supports it, or an A record with the host's IP.

  1. You changed an A record an hour ago. Your phone shows the new site, your friend's shows the old one. Bug?
Answer

No: your friend's resolver still has the old answer cached until its TTL runs out. Check the real answer with dig @<the domain's name server>.

  1. curl says no alternative certificate subject name matches target host name 'shop.example.in'. What's wrong?
Answer

The certificate doesn't list that name in its subject alternative names. Add the name (or add the domain at your host so it issues a certificate for it).

  1. An HTML form posts to http://... and the site redirects all HTTP with a 301. What can happen to the form data?
Answer

The client may switch the POST to a GET and drop the body, so the data is lost. Use 308 for non-GET requests, and make the form post to https:// directly.

  1. You add a second TXT record v=spf1 include:_spf.google.com ~all next to an existing SPF record. What happens?
Answer

Two SPF records make SPF invalid for the domain (receivers report an error), which can send your mail to spam. Merge both include: parts into one record.

Quiz

The host says: point to my-site.host.app. Which record for the bare domain canteen.in? A) CNAME to my-site.host.app · B) ALIAS (or an A record with the host's IP) · C) MX to my-site.host.app · D) A TXT record with the URL

Answer

B: the apex also holds NS and SOA records, so it can't be a CNAME. ALIAS behaves like a CNAME but answers with an IP. MX is for mail; TXT only holds text.

Interview questions

  1. What happens when you type a URL? The browser asks a resolver for the domain's IP (the resolver may answer from cache, or ask the root, the TLD and the domain's name servers), connects to that IP, does a TLS handshake checking the certificate, then sends the HTTP request.
  2. A vs CNAME? A maps a name to an IPv4 address; CNAME maps a name to another name. A CNAME can't coexist with other records at the same name, so not at the apex.
  3. What is TTL and how do you plan a DNS migration? How long resolvers may cache a record. Lower it well before the change (at least one old-TTL ahead), switch, verify, raise it again.
  4. How does a browser trust a certificate? It checks the certificate's chain up to a root CA in its trust store, that the name matches a SAN entry, that it's within its validity dates, and that the server proves it holds the private key.
  5. 301 vs 302 vs 307 vs 308? 301/308 are permanent, 302/307 temporary; 307 and 308 require the same method and body, while clients may change POST to GET after 301/302.
  6. SPF, DKIM, DMARC? SPF lists allowed sending servers; DKIM signs mail with a key published in DNS; DMARC tells receivers what to do when checks fail and where to send reports.

Glossary

Term Meaning (with an example from this episode)
IP address The number of a computer on a network (127.0.0.3).
IPv4 / IPv6 The older 4-number addresses / the newer, longer ones.
Host (hosting company) The company whose servers run your app.
Domain name A human name for an address (canteen.in).
Registrar The shop where you register a domain for a year at a time.
Renewal Paying again each year to keep the domain.
Apex / bare / root domain The domain itself, without anything in front (canteen.test).
Subdomain A name in front of the domain (www.canteen.test).
DNS (Domain Name System) The internet's contact list: names → addresses.
Name server The server that answers for a domain (ns1.canteen.test).
Authoritative server The domain's own name server, with the real current records (127.0.0.10).
Resolver The server your device asks; it finds and caches answers (Wi-Fi router, 127.0.0.11).
Cache A remembered copy of an answer, kept for the TTL.
DNS record One line in DNS.
Zone / zone file All the records for one domain / the file that holds them.
A record Name → IPv4 address.
AAAA record Name → IPv6 address.
CNAME record Name → another name (an alias).
ALIAS / ANAME / flattened CNAME A provider feature: behaves like a CNAME, answers with an IP, allowed at the apex.
NS record Which name servers answer for the domain.
SOA record The zone's header (main server, admin, serial number).
TXT record A record that just holds text (ownership proof, SPF, DMARC).
MX record Which servers receive email for the domain.
TTL (time to live) Seconds others may cache an answer (300 = 5 minutes).
DNS propagation Resolvers everywhere picking up a change as their caches expire.
NXDOMAIN DNS's "no such name" answer.
Trailing dot The final . that marks a full name in a zone file.
BIND / named A widely used DNS server program / its server process.
named-checkzone BIND's tool that checks a zone file for errors.
dig A command that asks a DNS server a question and prints the answer.
curl A command that makes web requests and shows the response.
tcpdump A command that records network traffic.
HTTP The web's request/response language, unencrypted (a postcard).
HTTPS HTTP inside an encrypted TLS connection (a sealed envelope).
Encryption Scrambling data so only the two ends can read it.
TLS / SSL The encryption system behind HTTPS / its old name.
Port 80 / 443 The usual doors for HTTP / HTTPS.
Certificate (SSL/TLS certificate) A signed file proving a server owns a name (the ID card).
Certificate authority (CA) An organisation browsers trust to sign certificates (Let's Encrypt; our practice CA).
Private key The secret half that only the server keeps (certs/canteen.key, never in Git).
CSR Certificate signing request: what you send a CA to get a certificate.
Subject alternative name (SAN) The list of names a certificate covers (canteen.test, www.canteen.test).
openssl A command-line tool for keys and certificates.
Let's Encrypt A free, automated, non-profit certificate authority used by many hosts.
HTTP-01 / DNS-01 challenge Ways a CA checks you control a domain (a file on the site / a DNS record).
Renewal (certificate) Getting a new certificate before the old one expires, automatically.
HSTS A header telling browsers to always use HTTPS for a site.
Redirect A response that sends the client to another URL.
301 / 308 Permanent redirects; 308 keeps the method and body, 301 may not.
GET / POST A request that asks for something / one that sends data.
SPF A TXT record listing servers allowed to send mail for the domain (only one per domain).
DKIM A public key in DNS used to check mail signatures.
DMARC A TXT record telling receivers what to do with failing mail (p=none: only report).
.test A domain ending reserved for testing; never sold.

Summary

  • A domain name is a name for an IP address; DNS is the internet's contact list. Change one record and every link keeps working.
  • A records hold numbers, CNAMEs point to names; the bare domain can't be a CNAME, so use ALIAS (or an A record and remember to update it).
  • One missing dot turned www into NXDOMAIN; one fixed A record broke the bare domain when the host moved.
  • TTL decides how long resolvers cache answers: propagation is caches expiring. Lower the TTL before a move.
  • HTTPS encrypts traffic (the PIN disappeared from the recording) and proves identity with a certificate from a CA; the errors you'll meet are untrusted CA, wrong name and expired.
  • The agent's HTTPS code was good, but its 301 redirect silently lost an order from an old client; 308 fixed it. Test old clients too.
  • Email needs MX, one SPF line, DKIM and DMARC; the agent correctly merged two SPF lines into one.

Next episode: Analytics, feedback and iteration.