Skills101

Computer Networks · Lesson 5 of 7 · Updated ·

HTTP, HTTPS and DNS — Methods, Status Codes, Cookies and Name Resolution

Every time you open a website or an app loads data, HTTP carries the request and response, DNS finds the server, and HTTPS keeps it private.

Part A — HTTP

An HTTP request (GET /learn, Host: skills101.in, headers) and the response (HTTP/1.1 200 OK, Content-Type, the HTML body), plus the main methods and status code groups

HTTP is a request–response protocol. The client (browser, app) sends a request; the server sends one response.

Methods

MethodMeaningExample
GETread dataload a course page
POSTcreate / submitsign up, submit code
PUTreplaceupdate a whole profile
PATCHchange partupdate only the phone number
DELETEremovedelete a comment

GET vs POST (interview favourite): GET sends data in the URL (visible, cached, bookmarkable, should not change anything); POST sends data in the body (for creating/changing data, not cached).

Status codes

RangeMeaningCommon ones
2xxsuccess200 OK, 201 Created, 204 No Content
3xxredirect301 Moved Permanently, 302 Found, 304 Not Modified
4xxclient error400 Bad Request, 401 Unauthorized (not logged in), 403 Forbidden (not allowed), 404 Not Found, 429 Too Many Requests
5xxserver error500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable

Stateless + cookies

HTTP is stateless — each request is independent. To remember you between requests, servers use cookies: the server sends Set-Cookie: session=abc123, and the browser sends Cookie: session=abc123 with every later request. That's how you stay logged in.

Part B — HTTPS

HTTPS = HTTP over TLS. TLS gives three things:

  1. Encryption — nobody on the Wi-Fi can read your password.
  2. Integrity — data can't be changed in transit.
  3. Authentication — the certificate proves you're really talking to skills101.in (signed by a trusted Certificate Authority).

During the TLS handshake, the browser checks the certificate, and both sides agree on a shared secret key using asymmetric (public-key) cryptography; the actual data is then encrypted with fast symmetric encryption.

Part C — DNS

People remember names; computers need IP addresses. DNS (Domain Name System) is the internet's phone book.

The browser asks a resolver; the resolver asks a root server, then the .in TLD server, then skills101.in's name server, which returns the IP address

  1. The browser checks its cache (and the OS cache).
  2. If not found, it asks a recursive resolver (your ISP's or 8.8.8.8).
  3. The resolver asks a root server → "ask the .in servers".
  4. The TLD server → "ask skills101.in's authoritative name server".
  5. The authoritative server returns the IP address.
  6. The answer is cached for its TTL, so next time it's instant.

Common DNS records

RecordMapsExample
Aname → IPv4skills101.in → 203.0.113.7
AAAAname → IPv6
CNAMEname → another namewww → skills101.in
MXdomain → mail server
TXTtext (verification, SPF)Google site verification

Common mistakes

  • Saying 401 and 403 are the same: 401 = not logged in; 403 = logged in but not allowed.
  • Thinking HTTPS hides which site you visit — it hides the content, but the domain is still visible to DNS/your ISP.
  • Using GET for actions that change data.

Quick recap

  • HTTP: request–response, stateless; methods GET/POST/PUT/PATCH/DELETE; status 2xx/3xx/4xx/5xx.
  • Cookies keep sessions across stateless requests.
  • HTTPS = HTTP + TLS: encryption, integrity, authentication via certificates.
  • DNS: browser cache → resolver → root → TLD → authoritative → IP, cached by TTL.

Practice what you learned

📝 Quiz: HTTP, HTTPS and DNS5 questions · instant answers & explanations · +10 XP · counts towards your free certificateTake the quiz →